prec method

Big prec(
  1. int sd, [
  2. RoundingMode? _rm
])

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.

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,
  );
}