在scala中试试这个:
val value1 = -1.3323651E7f
val value2 = Math.round(value1)
val value3 = value1.toInt
val value4 = Math.round(value3)
value1: Float = -1.3323651E7
value2: Int = -13323650
value3: Int = -13323651
value4: Int = -13323650
为什么value2
和value4
不同于value1
和value3
?