Skip to content

assertcheck v1.0.0


assertcheck / assert / inDelta

Function: inDelta() ​

ts
function inDelta(
   actual, 
   expected, 
   delta, 
   opts?): void;

Defined in: src/assert.ts:729

Asserts that |actual - expected| <= delta. Useful for floating-point comparisons and timing tolerances.

Parameters ​

ParameterType
actualnumber
expectednumber
deltanumber
opts?Opts

Returns ​

void

Example ​

ts
assert.inDelta(computed, 1.333, 0.001, "floating point result out of tolerance")

Released under the Apache 2.0 License. Built by Vagabond Studio — senior-only for growing companies.