squareRoot

Return the square root.

Human Summary

Use it for decimal square roots rounded by the current precision settings.

AI Contract

FieldValue
Kindinstance method
Canonical namesquareRoot
Aliasessqrt
Mutates receiverNo
ReturnsArithInstance
Accepts (string, base) overloadNo
Configuration dependenciesDECIMAL_PLACES, ROUNDING_MODE
Related methodssqrt

Signature

squareRoot(): ArithInstance;

Parameters

ParameterTypeRequiredNotes
None--This method does not take parameters.

Returns

Returns a new Arith instance. The receiver is not modified.

Behavior

  • Negative finite values return NaN.
  • Infinity returns Infinity; NaN returns NaN.
  • Finite results are rounded according to DECIMAL_PLACES and ROUNDING_MODE.

Examples

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

new Arith("81").squareRoot().toString(); // "9"

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