eq_approx

check equals a and b approx with epsilon

bool
eq_approx
(
A
B
E
)
(
A a
,
B b
,
E eps
)
if (
isNumeric!E
)

Parameters

a
Type: A

first value

b
Type: B

second value

eps
Type: E

numeric epsilon

Examples

assert(  eq_approx( [1.1f,2,3], [1,2,3], 0.2 ) );
assert( !eq_approx( [1.1f,2,3], [1,2,3], 0.1 ) );
assert( !eq_approx( [1.0f,2], [1,2,3], 1 ) );
static assert( !__traits(compiles, eq_approx( [[1,2]], [1,2] )) );

Meta