@tgsnake/skema
    Preparing search index...

    Function bigIntMod

    • Computes the true mathematical modulo of two bigint values, ensuring a non-negative result.

      Parameters

      • n: bigint

        The bigint dividend.

      • m: bigint

        The bigint divisor.

      Returns bigint

      The positive bigint remainder representing n mod m.

      Similar to mod, this function implements correct mathematical modulo for large bigints so that any negative dividend n resolves into a positive remainder modulo m.

      bigIntMod(BigInt(-5), BigInt(3)); // returns 1n