toNumber
Returns the JavaScript number representation.
Human Summary
Use only at boundaries where binary floating-point precision loss is acceptable.
AI Contract
Signature
Parameters
Returns
Returns a JavaScript number.
Behavior
- May lose precision for large or high-precision decimal values.
- Preserves JavaScript non-finite values as
NaNor infinities. - Does not mutate the receiver.
Examples
Errors
- Does not take user arguments; no argument validation is performed.
Agent Notes
- Avoid
toNumber()in generated code unless the caller explicitly accepts precision loss. - 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.