Import std.math.scalar
IsClose
function
Public Function IsClose<T>(a: T, b: T, tolerance: T): Bool
Whether a and b are no further apart than tolerance.
function
Public Function IsClose<T>(a: T, b: T): Bool
Whether a and b are equal but for rounding: no further apart than 0.00001 of the larger
one's size, or of 1 near 0. An infinity is close only to itself, and NaN to nothing.
Examples
Expect(IsClose(0.1 + 0.2, 0.3))
Expect(!IsClose(1.0, 1.1))Report an issue with this page or with FutureBlitz on GitHub.