effect-io-ai

Package: effect
Module: BigInt

BigInt.remainder

Returns the JavaScript remainder of dividing one bigint by another.

When to use

Use when you want native remainder semantics, including signed remainders and a thrown division-by-zero error.

Gotchas

Throws a RangeError when the divisor is 0n.

Example (Calculating remainders)

import { BigInt } from "effect"

BigInt.remainder(10n, 3n) // 1n

BigInt.remainder(15n, 4n) // 3n

See

Signature

declare const remainder: { (divisor: bigint): (self: bigint) => bigint; (self: bigint, divisor: bigint): bigint; }

Source

Since v4.0.0