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.

26 lines 824 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports._F64 = void 0; const range2d_js_1 = require("../../array/typed-array/2d/range2d/range2d.js"); /** * @public * Utilities relating to double precision floats. * * @remarks * See {@link _F64}. */ class _F64 { static getPrecision(value) { return value * _F64.mantissaPrecision; } static isEqual(a, b, delta = _F64.mantissaPrecision) { return Math.abs(a - b) < delta; } } exports._F64 = _F64; _F64.MAX_VALUE = Number.MAX_VALUE; _F64.MIN_POSITIVE_VALUE = Number.MIN_VALUE; _F64.bounds = range2d_js_1.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