UNPKG

rc-js-util

Version:

A collection of TS and C++ utilities to help writing performant and correct applications, achieved through strict typing and (removable) invariant checking.

22 lines 691 B
import { Range2d } from "../../array/typed-array/2d/range2d/range2d.js"; /** * @public * Utilities relating to double precision floats. * * @remarks * See {@link _F64}. */ export class _F64 { static getPrecision(value) { return value * _F64.mantissaPrecision; } static isEqual(a, b, delta = _F64.mantissaPrecision) { return Math.abs(a - b) < delta; } } _F64.MAX_VALUE = Number.MAX_VALUE; _F64.MIN_POSITIVE_VALUE = Number.MIN_VALUE; _F64.bounds = Range2d.f64.factory.createOne(-Number.MAX_VALUE, -Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE); _F64.mantissaBits = 52; _F64.mantissaPrecision = 1 / Math.pow(2, 52); //# sourceMappingURL=_f64.js.map