toDouble method

double toDouble()

Returns this as a double.

If the number is not representable as a double, an approximation is returned. For numerically large integers, the approximation may be infinite.

Implementation

double toDouble() => switch (this) {
      var d when d._scale > 0 => d._value / _i10.pow(d._scale),
      var d when d._scale < 0 => (d._value * _i10.pow(-d._scale)).toDouble(),
      var d => d._value.toDouble(),
    };