I have a PHP function as
function func(){
function round_up($value, $decPlaces) {
return ceil($value * pow(10, $decPlaces)) / pow(10, $decPlaces);
}
$a=21.31;
$b=2;
$c=10.64;
$d=0.03;
$xxx=$a;
$yyy=round_up($b*$c,2)+round_up($d,2);
$zzz=($xxx===$yyy);
var_dump($xxx,$yyy,$zzz);
}
This function outputs
float(21.31) float(21.31) bool(false)
It seems xxx equal to yyy but why zzz is false? Where is the problem in this function and result?