next method

  1. @override
double next()
override

The next draw in [0, 1). Stateful within one transition.

Implementation

@override
double next() {
  final result = (((_a + _b) & _mask32) + _d) & _mask32;
  final b = _b;
  final c = _c;
  _a = b ^ (b >>> 9);
  _b = (c + _shl32(c, 3)) & _mask32;
  _c = ((_shl32(c, 21) | (c >>> 11)) + result) & _mask32;
  _d = (_d + 1) & _mask32;
  // 2^32 is a power of two and the numerator is an exact integer below it,
  // so the quotient is the same double everywhere.
  return result / 4294967296;
}