effect-io-ai

Package: effect
Module: BigInt

BigInt.sign

Determines the sign of a given bigint.

When to use

Use to classify a bigint as negative, zero, or positive.

Example (Determining bigint signs)

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

assert.deepStrictEqual(BigInt.sign(-5n), -1)
assert.deepStrictEqual(BigInt.sign(0n), 0)
assert.deepStrictEqual(BigInt.sign(5n), 1)

Signature

declare const sign: (n: bigint) => Ordering

Source

Since v2.0.0