Skip to content
FutureBlitz

    Install

    Import std.math.scalar

    Mod

    std.math.scalar

    function

    @PanicsAtCaller Public Function Mod<T>(a: T, b: T): T

    The remainder of a divided by b with the sign of b, as dividing and rounding down leaves it: Mod(-1, 3) is 2, and Mod(1, -3) is -2. A b of 0 panics.

    Examples

    Expect(Mod(-1, 3) == 2)
    Expect(Rem(-1, 3) == -1)

    std/math/scalar.fb, line 86

    function

    Public Function Mod<T>(a: T, b: T): T

    The remainder of a divided by b with the sign of b, as dividing and rounding down leaves it: Mod(-1.5, 4.0) is 2.5, and a 0 has b's sign. A b of 0 gives NaN. A remainder too small beside b for their sum to be below it gives 0, which is as near, a whole b away.

    std/math/scalar.fb, line 96

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