AW: [PHP] PHP4 cuts floats down to ints...
| From: | Sebastian Stadtlich | Date: | Mon, 09 Oct 2000 13:18:16 +0000 |
| Subject: | AW: [PHP] PHP4 cuts floats down to ints... | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-19183@lists.php.net to get a copy of this message | ||
i had a similar problem with 4.0.2 running on NT
i just put a lot more brackets(?) in there
<?PHP echo ((1.5) * (8.7) / (4.5)); ?>
that worked for me.....
sebastian
> -----Ursprüngliche Nachricht-----
> Von: Sascha Dahl [mailto:sdahl@besteshop.de]
> Gesendet am: Montag, 9. Oktober 2000 15:16
> An: php-general@lists.php.net
> Betreff: [PHP] PHP4 cuts floats down to ints...
>
> 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
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>