prec method
Return a new Big whose value is the value of this Big rounded to a maximum precision of sd significant digits using rounding mode rm, or Big.rm if rm is not specified.
sd
int Significant digits: integer, 1 to maxDp inclusive.- rm? RoundingMode Rounding mode.
Implementation
Big prec(int sd, [RoundingMode? _rm]) {
if (sd != ~~sd || sd < 1 || sd > maxDp) {
throw BigError(code: BigErrorCode.dp);
}
return _round(
Big(this),
sd,
_rm,
);
}