标签: swift floating-point double
let test:Float = 187.67 let test2:Float = 234 print(test+test2) //output: 421.66998 let test3:Double = 187.67 let test4:Double = 234 print(test3+test4) //output: 421.66999999999996
显然,正确答案是421.67。 知道为什么它没有给我这个数字吗?