//等于比较
function floatcmp($f1,$f2,$precision = 10) {// are 2 floats equal
$e = pow(10,$precision);
$i1 = intval($f1 * $e);
$i2 = intval($f2 * $e);
return ($i1 == $i2);
}
//大于比较
function floatgtr($big,$small,$precision = 10) {// is one float bigger than another
$e = pow(10,$precision);
$ibig = intval($big * $e);
$ismall = intval($small * $e);
return ($ibig > $ismall);
}
//大于等于比较
function floatgtre($big,$small,$precision = 10) {// is on float bigger or equal to another
$e = pow(10,$precision);
$ibig = intval($big * $e);
$ismall = intval($small * $e);
return ($ibig >= $ismall);
}