Skip to content
FutureBlitz

    Install

    Import std.math.scalar

    IsClose

    std.math.scalar

    function

    Public Function IsClose<T>(a: T, b: T, tolerance: T): Bool

    Whether a and b are no further apart than tolerance.

    std/math/scalar.fb, line 294

    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))

    std/math/scalar.fb, line 308

    Report an issue with this page or with FutureBlitz on GitHub.