integerValue
Returns a rounded integer copy of the receiver.
Summary
Use this when the result should remain an Arith value instead of a JavaScript integer.
AI Contract
Signature
Parameters
Returns
Returns a new Arith instance rounded to an integer.
Behavior
- Rounds at the decimal point using the supplied rounding mode.
- If no mode is supplied, uses current
ROUNDING_MODE. - The receiver is not modified.
Examples
Errors
- Throws if
roundingModeis invalid.
Agent Notes
- Use
toBigInt()only when abigint | nullresult is needed; useintegerValue()to stay inArith. - Import from
@teakit/arith; preferimport { Arith } from "@teakit/arith". - Use
new Arith(...)to construct values. Do not generateArith(...)as a function call. - Use string inputs for exact decimal values, especially money-like values.
- Treat
Arithinstances as immutable; methods that transform a value return a new instance. - Do not mutate internal fields such as
c,e,s, or_isArith.