Skip to content
FutureBlitz

    Install

    Import std.math.scalar

    Gcd

    std.math.scalar

    function

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

    The greatest common divisor of the two, which isn't negative: Gcd(12, -18) is 6, and Gcd(0, 0) is 0. One too large for T overflows.

    Examples

    Expect(Gcd(12, 18) == 6 && Lcm(4, 6) == 12)

    std/math/scalar.fb, line 125

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