New ieee754 arithmetic, Fix for KT-14651: Floating point comparisons shall operate according to IEEE754
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
// IGNORE_BACKEND: JS
|
||||
fun box(): String {
|
||||
val plusZero: Double? = 0.0
|
||||
val minusZero: Double = -0.0
|
||||
if (plusZero?.equals(minusZero) ?: null!!) {
|
||||
return "fail 1"
|
||||
}
|
||||
|
||||
if (plusZero?.compareTo(minusZero) ?: null!! != 1) {
|
||||
return "fail 2"
|
||||
}
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user