cbrt

Returns the cube root of the receiver rounded by the current precision settings.

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

Arith.from("8").cbrt().toString(); // "2"
Arith.from("-8").cbrt().toString(); // "-2"

// Non-perfect cube roots are rounded by the constructor precision settings.
Arith.from("2").cbrt().toString(); // "1.25992104989487316477"

// Special values are preserved through the operation.
Arith.from("Infinity").cbrt().toString(); // "Infinity"
Arith.from("NaN").cbrt().toString(); // "NaN"

// Use the static helper when no method chain is needed.
Arith.cbrt("125").toString(); // "5"

API Reference

Signature

cbrt(): ArithInstance;

Parameters

ParameterTypeRequiredNotes
None--This method does not take parameters.

Returns

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

Throws

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

Agent Contract

FieldValue
Kindinstance method and static helper
Canonical namecbrt
AliasesNone
Mutates receiverNo
ReturnsArithInstance
Accepts (string, base) overloadNo
Configuration dependenciesDECIMAL_PLACES, ROUNDING_MODE
Related methodssqrt, pow

Agent Notes

  • Use cbrt() for cube roots, including negative real cube roots.
  • Do not generate cubeRoot.
  • Use string inputs for exact decimal values.
  • Treat Arith instances as immutable.