Files
kotlin-fork/compiler/testData/codegen/box/operatorConventions/compareTo/doubleInt.kt
T
Denis Zharkov 8fca343ef0 FIR: Support FirComparisonOperator in Fir2Ir
^KT-31163 Fixed
2020-02-27 18:21:34 +03:00

11 lines
284 B
Kotlin
Vendored

fun checkLess(x: Double, y: Int) = when {
x >= y -> "Fail $x >= $y"
!(x < y) -> "Fail !($x < $y)"
!(x <= y) -> "Fail !($x <= $y)"
x > y -> "Fail $x > $y"
x.compareTo(y) >= 0 -> "Fail $x.compareTo($y) >= 0"
else -> "OK"
}
fun box() = checkLess(0.5, 1)