nextInt method

  1. @override
int nextInt(
  1. int max
)
override

Generates an integer between 0 (inclusive) and max (exclusive).

Note that this produces an absolute max of 2^31-1 bits, to maintain cross-platform consistency. You can pass maxes that are higher, but they won't work.

Implementation

@override
int nextInt(int max) {
  int bits, val;
  bits = _updateState();
  val = bits % max;
  return val;
}