/** @packageDocumentation * @module Quantity */ import { QuantityProps, UnitConversionProps, UnitProps } from "./Interfaces"; /** * Checks if two numbers are approximately equal within given relative tolerance. * @param a - The first number to compare. * @param b - The second number to compare. * @param tolerance - Tolerance, scales based on the input number values (multiplied by 1, abs(a) or abs(b), whichever is biggest). * @returns True if the numbers are approximately equal, false otherwise. * @internal */ export declare function almostEqual(a: number, b: number, tolerance?: number): boolean; /** The Quantity class is convenient container to specify both the magnitude and unit of a quantity. This class is commonly * returned as the result of parsing a string that represents a quantity. * @beta */ export declare class Quantity implements QuantityProps { protected _magnitude: number; protected _unit: UnitProps; protected _isValid: boolean; get unit(): UnitProps; get magnitude(): number; get isValid(): boolean; /** Constructor. The Quantity will only be set as valid if a unit is specified. * @param unit Defines the quantity's unit. * @param magnitude Defines the magnitude of the quantity. */ constructor(unit?: UnitProps, magnitude?: number); /** Convert a Quantity to the specified unit given the UnitConversion. * @param toUnit The new unit for the quantity. * @param conversion Defines the information needed to convert the Quantity's magnitude from the current unit to another unit. This conversion info is usually * returned from the UnitsProvider. * @throws [[QuantityError]] with [[QuantityStatus.InvalidUnitConversion]] when `conversion.error === true`. * @throws [[QuantityError]] with [[QuantityStatus.InvertingZero]] when inversion would require dividing by zero or almost-zero. */ convertTo(toUnit: UnitProps, conversion: UnitConversionProps): Quantity; } /** Determines if a value is almost zero. (less than 1e-16) * @param value - The value to be checked. * @returns `true` if the value is almost zero, `false` otherwise. * @internal */ export declare function almostZero(value: number): boolean; /** * Applies a unit conversion to a given value. * Does not throw when `props.error === true`; callers are expected to have already handled that contract. * For the throwing apply helper, use `UnitConversions.convertValue(...)`. * @param value - The value to be converted. * @param props - The unit conversion properties. * @returns The converted value. * @internal */ export declare function applyConversion(value: number, props: UnitConversionProps): number; //# sourceMappingURL=Quantity.d.ts.map