Rename ClosedComparableRange to ClosedFloatingPointRange

This commit is contained in:
Ilya Gorbunov
2016-12-16 03:14:17 +03:00
parent 919c77b950
commit 10f8e70322
10 changed files with 31 additions and 31 deletions
@@ -13,7 +13,7 @@ class ComparablePair<T : Comparable<T>>(val first: T, val second: T) : Comparabl
fun <T : Comparable<T>> genericRangeTo(start: T, endInclusive: T) = start..endInclusive
operator fun Double.rangeTo(other: Double) = genericRangeTo(this, other)
// some weird inverted range
operator fun Float.rangeTo(other: Float) = object : ClosedComparableRange<Float> {
operator fun Float.rangeTo(other: Float) = object : ClosedFloatingPointRange<Float> {
override val endInclusive: Float = this@rangeTo
override val start: Float = other
override fun lessThanOrEquals(a: Float, b: Float) = a >= b