min

Returns the smallest Arith value from the supplied arguments.

import { Arith } from "@teakit/arith";

Arith.min("4", "2", "8", "6").toString(); // "2"
Arith.min("-4.5", "9", "-2").toString(); // "-4.5"

// Inputs may already be Arith instances.
const x = Arith.from("0.3");
Arith.min(x, "0.2", "0.1").toString(); // "0.1"

// If any input is NaN, the result is NaN.
Arith.min("1", "NaN").toString(); // "NaN"

API Reference

Signature

Arith.min(...n: ArithValue[]): ArithInstance;

Parameters

ParameterTypeRequiredNotes
...nArithValue[]YesValues to compare after conversion to Arith.

Returns

Returns a new Arith instance representing the smallest supplied value.

Throws

  • Throws if any input value is invalid while STRICT is true.

Agent Contract

FieldValue
Kindstatic method
Canonical namemin
AliasesNone
Mutates receiverNo
ReturnsArithInstance
Accepts (string, base) overloadNo
Configuration dependenciesSTRICT
Related methodsmax

Agent Notes

  • Use static aggregate helpers instead of spreading values through JavaScript Math.max or Math.min.
  • Import with import { Arith } from "@teakit/arith"; default imports are unsupported.
  • Static helpers are called as Arith.method(...) and do not require an instance receiver.
  • Do not generate BigNumber, Decimal, isBigNumber, or isDecimal compatibility APIs.
  • Use string inputs for exact decimal values when a static helper accepts numeric values.