effect-io-ai

Package: effect
Module: BigInt

BigInt.Order

Provides an Order instance for bigint that allows comparing and sorting BigInt values.

When to use

Use when you need to sort or compare bigint values through APIs that accept an ordering instance.

Example (Comparing bigints with Order)

import { BigInt } from "effect"

const a = 123n
const b = 456n
const c = 123n

console.log(BigInt.Order(a, b)) // -1 (a < b)
console.log(BigInt.Order(b, a)) // 1 (b > a)
console.log(BigInt.Order(a, c)) // 0 (a === c)

Signature

declare const Order: order.Order<bigint>

Source

Since v2.0.0