Re: [PHP-DEV] Floats and apache 1.3b6 From: Zeev Suraski (bourbon <email protected>)
Date: 04/30/98

At 15:01 30/04/98 +0200, Andreas Karajannis wrote:
>It seems that floats (e.g from database queries) get randomly rounded
>on output. I've seen this on Solaris/apache 1.3b6/oracle and have
>a report for Linux/apache 1.3b6/adabas.
>On my Linux box, with apache 1.2.6 I can't reproduce this "behaviour",
>so it seems to be apache related, maybe some *printf function?
>
>Sample Output: values stored in table:
>100.010002 100.01
>200.020004 200.02
>300.029999 300.03
>400.040009 400.04
>500.049988 500.05

Floating point numbers are not accurate, this is a typical behavior. If
you want to maintain full accuracy, keep these values as strings, and
manipulate them using the BC math library.

Zeev

--
Zeev Suraski   <zeev <email protected>>
For a PGP public key, finger bourbon <email protected>