sqrt
Returns an approximation to the square root of this with rounding according to the context settings.
The preferred _scale of the returned result is equal to this._scale()/2. The value of the returned result is always within one ulp of the exact decimal value for the _precision in question. If the rounding mode is , HALF_DOWN, or HALF_EVEN, the result is within one half an ulp of the exact decimal value.
Special case:
The square root of a number numerically equal to
ZEROis numerically equal toZEROwith a preferred _scale according to the general rule above. In particular, forZERO,ZERO.sqrt(mc).equals(ZERO)is true with anyMathContextas an argument.
Return
the square root of this.
Since
9
See also
Parameters
the context to use.
Throws
if (mc.getRoundingMode()==RoundingMode.UNNECESSARY) and the exact result cannot fit in mc.getPrecision() digits.