maximum

Return the largest value from the supplied arguments.

Summary

Use it to choose the greatest exact decimal value without converting to JavaScript numbers.

AI Contract

FieldValue
Kindstatic method
Canonical namemaximum
Aliasesmax
Mutates receiverNo
ReturnsArithInstance
Accepts (string, base) overloadNo
Configuration dependenciesSTRICT
Related methodsminimum, min

Signature

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

Parameters

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

Returns

Returns a new Arith instance representing the largest supplied value.

Behavior

  • Arguments are converted with the Arith constructor.
  • Comparison preserves arbitrary precision and handles signed values.
  • If any compared value is NaN, the result follows Arith comparison behavior and may become NaN.

Examples

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

const result = Arith.maximum("4.5", "9", "-2");

result.toString(); // "9"

Errors

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

Agent Notes

  • Use static aggregate helpers instead of spreading values through JavaScript Math.max or Math.min.
  • Import from @teakit/arith; prefer import { Arith } from "@teakit/arith".
  • 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.

See Also