Files
kotlin-fork/compiler/testData/codegen/box/ieee754/comparableToTWithT_properIeeeComparisons.kt
T
2018-06-14 19:54:30 +03:00

11 lines
293 B
Kotlin
Vendored

// !LANGUAGE: +ProperIeee754Comparisons
fun less(x: Comparable<Float>, y: Float) = x is Float && x < y
fun less(x: Comparable<Double>, y: Double) = x is Double && x < y
fun box(): String {
if (less(-0.0F, 0.0F)) return "Fail F"
if (less(-0.0, 0.0)) return "Fail D"
return "OK"
}