Hyperlinkv0.8.0-beta.28

BigInt

BigInt.subtractconsteffect/BigInt.ts:152
(that: bigint): (self: bigint) => bigint
(self: bigint, that: bigint): bigint

Provides a subtraction operation on bigints.

When to use

Use to subtract one bigint value from another.

Example (Subtracting bigints)

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

assert.deepStrictEqual(BigInt.subtract(2n, 3n), -1n)
math
Source effect/BigInt.ts:1524 lines
export const subtract: {
  (that: bigint): (self: bigint) => bigint
  (self: bigint, that: bigint): bigint
} = dual(2, (self: bigint, that: bigint): bigint => self - that)