@tgsnake/skema
    Preparing search index...

    Function bigIntPow

    • Computes base-x raised to exponent-y, with an optional modular reduction z.

      Parameters

      • x: bigint

        The base bigint value.

      • y: bigint

        The exponent bigint value (must be non-negative if modulus is specified).

      • Optionalz: bigint

        Optional modulus bigint value.

      Returns bigint

      If z is not defined: x ** y. If z is defined: (x ** y) % z.

      Uses an efficient binary exponentiation algorithm (square-and-multiply) to handle extremely large values of x, y, and z securely without precision loss.

      const result = bigIntPow(BigInt(5), BigInt(3), BigInt(7)); // (5 ** 3) % 7 = 6