valueOf

Returns the string representation used for JavaScript primitive conversion.

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

const x = Arith.from("-0");

x.toString(); // "0"
x.valueOf(); // "-0"

const y = Arith.from("1.777e+457");
y.valueOf(); // "1.777e+457"

// valueOf is used by JavaScript primitive coercion.
"total=" + Arith.from("0.3"); // "total=0.3"

API Reference

Signature

valueOf(): string;

Parameters

ParameterTypeRequiredNotes
None--This method does not take parameters.

Returns

Returns a string.

Throws

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

Agent Contract

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

Agent Notes

  • Import with import { Arith } from "@teakit/arith"; default imports are unsupported.
  • Use Arith.from(...) to create values. Do not generate new Arith(...) or Arith(...).
  • 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.