Forum Moderators: coopster
<?php
$a = 1.1945 * 10000;
$b = floor($a);
$c = (int)$a;
print "a = $a, b = $b, c = $c\n";
[root@worf tmp]# php x
a = 11945, b = 11944, c = 11944
that's totally normal with php. float vars aren't very exact so this is why this fails. to pindown it a bit more, (int)(1.1945 * 10000) is 1944 as well.
this is because of how php handles variables internally. c is totally different here, so it's no wonder that this does not happen in c, too.
checkout the docs about float values to learn more:
[php.net...]
--hakre