effect-io-ai

Package: effect
Module: BigInt

BigInt.lcm

Determines the least common multiple of two bigints.

When to use

Use to compute the least common multiple of two integer values.

Example (Calculating least common multiples)

import { BigInt } from "effect"
import * as assert from "node:assert"

assert.deepStrictEqual(BigInt.lcm(2n, 3n), 6n)
assert.deepStrictEqual(BigInt.lcm(2n, 4n), 4n)
assert.deepStrictEqual(BigInt.lcm(16n, 24n), 48n)

See

Signature

declare const lcm: { (that: bigint): (self: bigint) => bigint; (self: bigint, that: bigint): bigint; }

Source

Since v2.0.0