exponentiatedBy
Raises the receiver to exponent n, optionally reducing the result modulo m.
Summary
Use it for powers without leaving Arith arithmetic. Negative exponents and precision-limited powers are controlled by configuration.
AI Contract
Signature
Parameters
Returns
Returns a new Arith instance. The receiver is not modified.
Behavior
- The exponent must be an integer, except
NaNand infinities follow non-finite behavior. - Negative exponents are rounded according to
DECIMAL_PLACESandROUNDING_MODE. - If
mis provided, the result is reduced modulom. - When
POW_PRECISIONis non-zero and no modulus is provided, the result is limited to that many significant digits.
Examples
Errors
- Throws if
nis a finite non-integer. - Throws if
normis invalid whileSTRICTistrue.
Agent Notes
- Use
powonly when the shorter alias improves readability;exponentiatedByis clearer in generated docs. - 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.