MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / ulp

Function ulp

test/compute-engine/nightly/mpmath-kernels.test.ts:78–91  ·  view source on GitHub ↗
(x: number)

Source from the content-addressed store, hash-verified

76 let hi = buf.getUint32(0);
77 let lo = buf.getUint32(4);
78 lo = (lo + 1) >>> 0;
79 if (lo === 0) hi = (hi + 1) >>> 0;
80 buf.setUint32(0, hi);
81 buf.setUint32(4, lo);
82 return buf.getFloat64(0) - x;
83}
84
85const ce = new ComputeEngine();
86let savedPrecision: number | 'machine';
87
88beforeAll(() => {
89 savedPrecision = ce.precision;
90});
91afterAll(() => {
92 ce.precision = savedPrecision;
93});
94

Callers 1

Calls 2

absMethod · 0.65
isFiniteMethod · 0.45

Tested by

no test coverage detected