Hyperlinkv0.8.0-beta.28

BigDecimal

BigDecimal.maxconsteffect/BigDecimal.ts:986
(that: BigDecimal): (self: BigDecimal) => BigDecimal
(self: BigDecimal, that: BigDecimal): BigDecimal

Returns the maximum between two BigDecimals.

When to use

Use to select the larger of two BigDecimal values.

Example (Selecting the larger decimal)

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

assert.deepStrictEqual(
  BigDecimal.max(BigDecimal.fromStringUnsafe("2"), BigDecimal.fromStringUnsafe("3")),
  BigDecimal.fromStringUnsafe("3")
)
mathmin
export const max: {
  (that: BigDecimal): (self: BigDecimal) => BigDecimal
  (self: BigDecimal, that: BigDecimal): BigDecimal
} = order.max(Order)