Ranges, Progressions and related top-level and extension functions.
Represents a range of floating point numbers. Extends ClosedRange interface providing custom operation lessThanOrEquals for comparing values of range domain type.
Represents a range of values (for example, numbers or characters). See the Kotlin language documentation for more information.
Ensures that this value is not less than the specified minimumValue.
Ensures that this value is not greater than the specified maximumValue.
Ensures that this value lies in the specified range minimumValue..maximumValue.
Ensures that this value lies in the specified range.
Returns true
if this range contains the specified element.
Checks if the specified value belongs to this range.
Returns true
if this iterable range contains the specified element.
Returns a progression from this value down to the specified to value with the step -1.
Returns a random element from this range.
Returns a random element from this range, or null
if this range is empty.
Returns a random element from this range using the specified source of randomness, or null
if this range is empty.
Creates a range from this Comparable value to the specified that value.
Returns a progression that goes over the same range in the opposite direction with the same step.
Returns a progression that goes over the same range with the given step.
© 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.ranges/index.html