Files
kotlin/compiler/testData/codegen/box/ieee754/dataClass.kt
Ting-Yuan Huang 9fc869397d IrBuiltins: refactoring for equality checks
Previously,
* Equals performs IEEE 754 equality check for floating points and
  byte-to-byte checks for other types, including references.
* Ieee754Equals performs IEEE 754 for primitive types
* TotalOrderEquals performs total order equals to all types, including
  floating points.

Now it is simplified,
* Equals performs total order checks for all types.
* Ieee754Equals performs IEEE 754 for primitive types.
* (TotalOrderEquals is removed.)
2019-04-02 13:16:31 +02:00

8 lines
194 B
Kotlin
Vendored

data class Test(val z1: Double, val z2: Double?)
fun box(): String {
val x = Test(Double.NaN, Double.NaN)
val y = Test(Double.NaN, Double.NaN)
return if (x == y) "OK" else "fail"
}