MCPcopy Index your code
hub / github.com/ChartGPU/ChartGPU / assertApprox

Function assertApprox

examples/acceptance/zoom-state.ts:23–27  ·  view source on GitHub ↗
(label: string, actual: number, expected: number, eps: number)

Source from the content-addressed store, hash-verified

21};
22
23const assertApprox = (label: string, actual: number, expected: number, eps: number): void => {
24 if (!Number.isFinite(actual) || Math.abs(actual - expected) > eps) {
25 throw new Error(`${label}: expected ~${expected} (±${eps}) but got ${actual}`);
26 }
27};
28
29// setRange clamp + ordering
30{

Callers 1

zoom-state.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected