MCPcopy Create free account
hub / github.com/melonjs/melonJS / toBeCloseTo

Function toBeCloseTo

packages/melonjs/src/math/math.ts:178–180  ·  view source on GitHub ↗
(expected: number, actual: number, precision = 2)

Source from the content-addressed store, hash-verified

176 * }
177 */
178export function toBeCloseTo(expected: number, actual: number, precision = 2) {
179 return Math.abs(expected - actual) < Math.pow(10, -precision) / 2;
180}
181
182/**
183 * Calculates the power of a number.

Callers 1

updateTargetMethod · 0.90

Calls 1

absMethod · 0.45

Tested by

no test coverage detected