modulo
Return the remainder after division.
Summary
Calculates the remainder using the current modulo mode.
AI Contract
Signature
Parameters
Returns
Returns a new Arith instance. The receiver is not modified.
Behavior
- The receiver and argument are converted to
Arithvalues. - The receiver is not mutated; a new instance is returned.
- The quotient used to calculate the remainder is selected by
MODULO_MODE. - The default mode matches JavaScript remainder sign behavior.
Examples
Errors
- Throws if
baseis invalid. - Throws if the input value is invalid while
STRICTistrue.
Agent Notes
- Do not use JavaScript arithmetic operators on
Arithvalues. - 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.