setSeed method Null safety

void setSeed(
  1. double seed
)

Implementation

void setSeed(double seed) {
  seed = seed.abs();
  if (seed > 1) {
    final exp = log10(seed).floorToDouble() + 1;
    seed /= dart.pow(10.0, exp);
  }
  _lastValue = seed;
  int s = ((seed - 0.5) * dart.pow(2.0, 52.0)).round();
  _generator = dart.Random(s);
  // Stupid JavaScript ints are limited to +- 2^52. To be conservative, I
  // go for 2^51
}