关于浮点数比较


#1

This post, it said:

But this code, it says -0.0 isn't less than 0.0:

Is it a bug?


#2

看起来 java.lang.Double(-0.0) < 0.0 返回的是 true,似乎只对于包装类型有这种特性


#3

Scala也是这样的


京ICP备16022265号-2 Kotlin China 2017 - 2018