clone
Creates a new constructor with its own configuration state.
Human Summary
Use clone when a module needs local decimal, rounding, formatting, or random settings without changing global Arith behavior elsewhere.
AI Contract
Signature
Parameters
Returns
Returns a new Arith constructor. Instances created by the clone use that clone's configuration.
Behavior
- The returned constructor has the same methods and constants as
Arith. - Configuration changes on the clone do not affect the original constructor.
- Passing a config object is equivalent to cloning and then calling
.config(object)on the clone.
Examples
Errors
- Throws if
objectis provided but is not a valid config object. - Throws if any supplied config field is invalid.
Agent Notes
- Prefer
Arith.clone()over sharedArith.config()in reusable libraries. - Import from
@teakit/arith; preferimport { Arith } from "@teakit/arith". - Static helpers are called as
Arith.method(...)and do not require an instance receiver. - Do not generate
BigNumber,Decimal,isBigNumber, orisDecimalcompatibility APIs. - Use string inputs for exact decimal values when a static helper accepts numeric values.