Kotlin浮点数Float整数Int乘*除/精度损失
Kotlin
fun main(args: Array<String>) {
val af: Float = 1.7f
var ci: Int = (af / 2).toInt()
val i: Int = 5
println(af / 2)
println(ci)
println(af / 2f)
println(i / 2)
println(i / 2f)
println(af * i)
}
0.85
0
0.85
2
2.5
8.5