mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-16 08:31:35 +00:00
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.)
8 lines
194 B
Kotlin
Vendored
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"
|
|
} |