@technobuddha/library
Version:
A large library of useful functions
17 lines (16 loc) • 614 B
TypeScript
export declare type Options = {
/** Tolerance range. If specified, should be greater than 0. **/
tolerance?: number;
};
/**
* Tests whether the two values are equal to each other, within a certain
* tolerance, taking into account floating point errors (numbers within EPSILON).
*
* @param a First number to compare.
* @param b Second number to compare.
* @param __namedParameters see {@link Options}
* @default tolerance 0
* @return true if *a* and *b* are nearly equal.
*/
export declare function almostEquals(a: number, b: number, { tolerance }?: Options): boolean;
export default almostEquals;