PHP4 cuts floats down to ints...
| From: | Sascha Dahl | Date: | Mon, 09 Oct 2000 13:16:29 +0000 |
| Subject: | PHP4 cuts floats down to ints... | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-19182@lists.php.net to get a copy of this message | ||
Hi everybody!
We´re encountering strange problems when using PHP´s _basic_ math functions.
It seems that PHP cuts every number to an integer, no matter what type it
used to be. For example if we execute
<?PHP echo (1.5 * 8.7 / 4.5); ?>
the result is 2. Just if the interpreter calculated 1*8/4.
This "error" doesn´t appear on our local environment where we use PHP3, but
it occurs on our WebServer running PHP4. It doesn´t matter if we use native
float numbers like in the example above or define strings like "1.9985". In
the last case the string has the correct value. At the point the calculation
is performed the number is cut down to 1.
We believe that there is some wrong configuration option in our php.ini but
can´t figure out what it may be. Maybe anyone can help us.
Thanks in advance,
Sascha Dahl
bestEshop.de AG
TechnologieZentrum
Friedrich-Ebert-Str.
51429 Bergisch Gladbach
e-mail: sdahl@besteshop.de