W3cubDocs

/Kotlin

nextLong

Platform and version requirements: JVM (1.3), JS (1.3), Native (1.3)
fun Random.nextLong(range: LongRange): Long

Gets the next random Long from the random number generator in the specified range.

Generates a Long random value uniformly distributed in the specified range: from range.start inclusive to range.endInclusive inclusive.

Exceptions

IllegalArgumentException - if range is empty.

© 2010–2020 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.random/next-long.html