leastSignificantDigit method Null safety

int leastSignificantDigit(
  1. double value
)

See DisplayMode.leastSignificantDigit

This assumes scientific notation, and is overriden for fixed-point.

Implementation

int leastSignificantDigit(double value) {
  if (value != 0) {
    return log(value.abs()).floor() - fractionDigits;
  } else {
    return -fractionDigits;
  }
}