MCPcopy Create free account
hub / github.com/effect-app/libs / fromNumber

Function fromNumber

repos/effect/packages/effect/src/BigInt.ts:912–922  ·  view source on GitHub ↗
(n: number)

Source from the content-addressed store, hash-verified

910 *
911 * Throws a `RangeError` when the divisor is `0n`.
912 *
913 * **Example** (Calculating remainders)
914 *
915 * ```ts import.meta.vitest
916 * import { BigInt } from "effect"
917 *
918 * BigInt.remainder(10n, 3n) // => 1n
919 * BigInt.remainder(15n, 4n) // => 3n
920 * ```
921 *
922 * @see {@link divide} for quotient calculation with division-by-zero represented as `Option.none`
923 *
924 * @category math
925 * @since 4.0.0

Callers

nothing calls this directly

Calls 2

someMethod · 0.80
BigIntInterface · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…