The following very simple piece of code and the resultung output is a mystery for me:
Code: Select all
<?php
$x=2.1 - 1.5;
if ($x==0.6)
echo "Equal";
else
echo "Oops!";
$y=0.2+0.4;
if ($y==0.6)
echo "Equal";
else
echo "Oops!";
$z=1.2+0.1;
if ($z==1.3)
echo "Equal";
else
echo "Oops!";
?>On PHP 4.0 I get the resulting output:
Oops!Oops!Equal
This means the first two comparisons have the result FALSE, which I do not understand.
Can anybody explain this behaviour?
Thank you in advance ...