open fun nextInt(): Int
fun nextInt(): Int
Gets the next random Int
from the random number generator.
Generates an Int
random value uniformly distributed between Int.MIN_VALUE
and Int.MAX_VALUE
(inclusive).
open fun nextInt(until: Int): Int
fun nextInt(until: Int): Int
Gets the next random non-negative Int
from the random number generator less than the specified until bound.
Generates an Int
random value uniformly distributed between 0
(inclusive) and the specified until bound (exclusive).
until
- must be positive.
IllegalArgumentException
- if until is negative or zero.
open fun nextInt(from: Int, until: Int): Int
fun nextInt(from: Int, until: Int): Int
© 2010–2019 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.random/-random/next-int.html