只有以下两个值不正确
((1.005 * 1000),(1.015 * 1000))
如果有人知道请解释为什么这个值
(1.015 * 1000)= 1014.9999999
而不是1015.剩余的值正常工作,如
1.020 * 1000 = 1020
<?php
//These 2 are not returning the expected results
var_dump((1.005*1000)%5==0); //boolean false
var_dump((1.015*1000)%5==0); //boolean false
var_dump((1.005*1000)%5==0); //boolean false
var_dump((1.010*1000)%5==0); //boolean true
var_dump((1.015*1000)%5==0); //boolean false
var_dump((1.020*1000)%5==0); //boolean true
var_dump((1.025*1000)%5==0); //boolean true
var_dump((1.030*1000)%5==0); //boolean true
var_dump((1.035*1000)%5==0); //boolean true
var_dump((1.035*1000)%5==0); //boolean true
var_dump((1.040*1000)%5==0); //boolean true
var_dump((1.045*1000)%5==0); //boolean true
var_dump((1.050*1000)%5==0); //boolean true
var_dump((1.055*1000)%5==0); //boolean true
var_dump((1.060*1000)%5==0); //boolean true
var_dump((1.065*1000)%5==0); //boolean true
var_dump((1.070*1000)%5==0); //boolean true
var_dump((1.075*1000)%5==0); //boolean true
var_dump((1.080*1000)%5==0); //boolean true
var_dump((1.085*1000)%5==0); //boolean true
var_dump((1.090*1000)%5==0); //boolean true
var_dump((1.095*1000)%5==0); //boolean true
var_dump((1.100*1000)%5==0); //boolean true