(that: bigint): (self: bigint) => bigint
(self: bigint, that: bigint): bigintReturns the minimum between two bigints.
When to use
Use to select the smaller of two bigint values.
Example (Finding the minimum bigint)
import { BigInt } from "effect"
import * as assert from "node:assert"
assert.deepStrictEqual(BigInt.min(2n, 3n), 2n)export const const min: {
(that: bigint): (self: bigint) => bigint
(self: bigint, that: bigint): bigint
}
Returns the minimum between two bigints.
When to use
Use to select the smaller of two bigint values.
Example (Finding the minimum bigint)
import { BigInt } from "effect"
import * as assert from "node:assert"
assert.deepStrictEqual(BigInt.min(2n, 3n), 2n)
min: {
(that: bigintthat: bigint): (self: bigintself: bigint) => bigint
(self: bigintself: bigint, that: bigintthat: bigint): bigint
} = import orderorder.const min: <A>(O: Order<A>) => {
(that: A): (self: A) => A
(self: A, that: A): A
}
Returns the minimum of two values according to the given order. If they are equal, returns the first argument.
When to use
Use when you need to select the smaller of two values according to an
Order.
Details
Returns the value that compares as less than or equal to the other value. If
values are equal, the first argument is returned.
Example (Selecting the minimum value)
import { Order } from "effect"
const minNumber = Order.min(Order.Number)
console.log(minNumber(1, 2)) // 1
console.log(minNumber(2, 1)) // 1
console.log(minNumber(1, 1)) // 1
min(const Order: order.Order<bigint>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)
Order)