ClosedFloatingPointRange

Represents a range of floating point numbers. Extends ClosedRange interface providing custom operation lessThanOrEquals for comparing values of range domain type.

This interface is implemented by floating point ranges returned by Float.rangeTo and Double.rangeTo operators to achieve IEEE-754 comparison order instead of total order of floating point numbers.

Since Kotlin

1.1

Properties

Link copied to clipboard
abstract val endInclusive: T

The maximum value in the range (inclusive).

Since Kotlin 1.1
Link copied to clipboard
abstract val start: T

The minimum value in the range.

Since Kotlin 1.1

Functions

Link copied to clipboard
open operator override fun contains(value: T): Boolean

Checks whether the specified value belongs to the range.

Since Kotlin 1.1
Link copied to clipboard
@JvmName(name = "byteRangeContains")
operator fun ClosedRange<Byte>.contains(value: Double): Boolean
@JvmName(name = "byteRangeContains")
operator fun ClosedRange<Byte>.contains(value: Float): Boolean
@JvmName(name = "byteRangeContains")
operator fun ClosedRange<Byte>.contains(value: Int): Boolean
@JvmName(name = "byteRangeContains")
operator fun ClosedRange<Byte>.contains(value: Long): Boolean
@JvmName(name = "byteRangeContains")
operator fun ClosedRange<Byte>.contains(value: Short): Boolean
@JvmName(name = "doubleRangeContains")
operator fun ClosedRange<Double>.contains(value: Byte): Boolean
@JvmName(name = "doubleRangeContains")
operator fun ClosedRange<Double>.contains(value: Float): Boolean
@JvmName(name = "doubleRangeContains")
operator fun ClosedRange<Double>.contains(value: Int): Boolean
@JvmName(name = "doubleRangeContains")
operator fun ClosedRange<Double>.contains(value: Long): Boolean
@JvmName(name = "doubleRangeContains")
operator fun ClosedRange<Double>.contains(value: Short): Boolean
@JvmName(name = "floatRangeContains")
operator fun ClosedRange<Float>.contains(value: Byte): Boolean
@JvmName(name = "floatRangeContains")
operator fun ClosedRange<Float>.contains(value: Double): Boolean
@JvmName(name = "floatRangeContains")
operator fun ClosedRange<Float>.contains(value: Int): Boolean
@JvmName(name = "floatRangeContains")
operator fun ClosedRange<Float>.contains(value: Long): Boolean
@JvmName(name = "floatRangeContains")
operator fun ClosedRange<Float>.contains(value: Short): Boolean
@JvmName(name = "intRangeContains")
operator fun ClosedRange<Int>.contains(value: Byte): Boolean
@JvmName(name = "intRangeContains")
operator fun ClosedRange<Int>.contains(value: Double): Boolean
@JvmName(name = "intRangeContains")
operator fun ClosedRange<Int>.contains(value: Float): Boolean
@JvmName(name = "intRangeContains")
operator fun ClosedRange<Int>.contains(value: Long): Boolean
@JvmName(name = "intRangeContains")
operator fun ClosedRange<Int>.contains(value: Short): Boolean
@JvmName(name = "longRangeContains")
operator fun ClosedRange<Long>.contains(value: Byte): Boolean
@JvmName(name = "longRangeContains")
operator fun ClosedRange<Long>.contains(value: Double): Boolean
@JvmName(name = "longRangeContains")
operator fun ClosedRange<Long>.contains(value: Float): Boolean
@JvmName(name = "longRangeContains")
operator fun ClosedRange<Long>.contains(value: Int): Boolean
@JvmName(name = "longRangeContains")
operator fun ClosedRange<Long>.contains(value: Short): Boolean
@JvmName(name = "shortRangeContains")
operator fun ClosedRange<Short>.contains(value: Byte): Boolean
@JvmName(name = "shortRangeContains")
operator fun ClosedRange<Short>.contains(value: Double): Boolean
@JvmName(name = "shortRangeContains")
operator fun ClosedRange<Short>.contains(value: Float): Boolean
@JvmName(name = "shortRangeContains")
operator fun ClosedRange<Short>.contains(value: Int): Boolean
@JvmName(name = "shortRangeContains")
operator fun ClosedRange<Short>.contains(value: Long): Boolean

Checks if the specified value belongs to this range.

Since Kotlin 1.0
Link copied to clipboard
open override fun isEmpty(): Boolean

Checks whether the range is empty.

Since Kotlin 1.1
Link copied to clipboard
abstract fun lessThanOrEquals(a: T, b: T): Boolean

Compares two values of range domain type and returns true if first is less than or equal to second.

Since Kotlin 1.1