BigDecimal.sqrt

Returns the square root of a BigDecimal value.

Syntax

BigDecimal.sqrt(value, rounding)

Parameters

Return value

A new BigDecimal.

Throws a RangeError exception if the value is less than zero or the rounding object is not present.

Examples

BigDecimal.sqrt(64m, { roundingMode: 'half-up', maximumFractionDigits: 0 })
8