Function modBig

  • Performs the modulo operation (remainder of division) for two Big instances.

    Parameters

    • dividend: Big

      The Big instance representing the dividend.

    • divisor: Big

      The Big instance representing the divisor.

    • Optional mutable: boolean = false

      Whether to mutate the first Big instance. Defaults to false.

    Returns Big

    A new Big instance representing the remainder of the division.

    Throws

    Division by zero is not allowed.

    Example

    const big1 = new Big(10);
    const big2 = new Big(3);
    console.log(modBig(big1, big2).toString()); // "1"
    console.log(modBig(big2, big1).toString()); // "3"
    console.log(modBig(big1, big1).toString()); // "0"

Generated using TypeDoc