New ieee754 arithmetic, Fix for KT-14651: Floating point comparisons shall operate according to IEEE754

This commit is contained in:
Mikhael Bogdanov
2016-11-22 16:27:35 +01:00
parent f9b40585cd
commit 627dd66ed5
62 changed files with 1632 additions and 22 deletions
@@ -0,0 +1,15 @@
fun box(): String {
val plusZero: Any? = 0.0
val minusZero: Any? = -0.0
if ((minusZero as Double) < (plusZero as Double)) return "fail 0"
val plusZeroF: Any? = 0.0F
val minusZeroF: Any? = -0.0F
if ((minusZeroF as Float) < (plusZeroF as Float)) return "fail 1"
if ((minusZero as Double) != (plusZero as Double)) return "fail 3"
if ((minusZeroF as Float) != (plusZeroF as Float)) return "fail 4"
return "OK"
}