I run a few erro checks on my site and one of them seems to have hit a brick wall...
if (29.9+0.49==30.39) {
echo "1";
} else {
echo "0";
}
this always prints 0
Can anyone explain why and what i need to do with 29.9 to get it to print 1 ...
I've tried round,2 and also tries settype to double...
The fundamental problem lies in the fact that
echo 29.9+0.49-30.39;
prints -3.5527136788005E-15
but
echo 29.91+0.49-30.40;
prints 0;
Any ideas .. problem seems to be the 29.9
Thanks
Gary