feqrel

fnint feqrel(X)(const X x, const X y) if (isFloatingPoint!(X)) @trusted pure nothrow @nogc

To what precision is x equal to y?

Returns

the number of mantissa bits which are equal in x and y.

eg, 0x1.F8p+60 and 0x1.F1p+60 are equal to 5 bits of precision.

x y feqrel(x, y)
x x real.mant_dig
x ≥= 2*x 0
x <= x/2 0
NaN any 0
any NaN 0