valueOf

Returns a string representation intended for primitive conversion.

Summary

Use explicit output methods instead of relying on coercion; valueOf is mainly for JavaScript integration.

AI Contract

FieldValue
Kindinstance method
Canonical namevalueOf
AliasesNone
Mutates receiverNo
Returnsstring
Accepts (string, base) overloadNo
Configuration dependenciesEXPONENTIAL_AT
Related methodstoJSON, toString

Signature

valueOf(): string;

Parameters

ParameterTypeRequiredNotes
None--This method does not take parameters.

Returns

Returns a string.

Behavior

  • Returns a base-10 string.
  • Includes the sign for negative zero.
  • Does not accept a base argument.

Examples

import { Arith } from "@teakit/arith";

new Arith("-0").valueOf(); // "-0"

Errors

  • Does not take user arguments; no argument validation is performed.

Agent Notes

  • Import from @teakit/arith; prefer import { Arith } from "@teakit/arith".
  • Use new Arith(...) to construct values. Do not generate Arith(...) as a function call.
  • Use string inputs for exact decimal values, especially money-like values.
  • Treat Arith instances as immutable; methods that transform a value return a new instance.
  • Do not mutate internal fields such as c, e, s, or _isArith.

See Also