ID:               47107
 User updated by:  mucahitkahveci at gmail dot com
 Reported By:      mucahitkahveci at gmail dot com
 Status:           Bogus
 Bug Type:         Scripting Engine problem
 Operating System: Windows xp sp2
-PHP Version:      5.2.8
+PHP Version:      5.2.2
 New Comment:

I understand that, but isn't it a big problem? Since php supports
integers for "maximum value of about two billion" (php manual) in which
it than changes to floating point numbers for numbers bigger than this.
So for any value its bigger than 15 digit its a very very big problem
while querying in a database. For example mysql has bigint type which
supports a maximum of 20 digits. But because of this behaviour of php we
have to use only upto 15 digits!! And if someone skips this detail it
would cause problems that is impossible to solve

Thanks


Previous Comments:
------------------------------------------------------------------------

[2009-01-15 12:48:30] j...@php.net

Floating point values have a limited precision. Hence a value might 
not have the same string representation after any processing. That also
includes writing a floating point value in your script and directly 
printing it without any mathematical operations.

If you would like to know more about "floats" and what IEEE
754 is, read this:
http://docs.sun.com/source/806-3568/ncg_goldberg.html
 
Thank you for your interest in PHP.

And 32bit issue..etc. etc. No bug.

------------------------------------------------------------------------

[2009-01-14 19:57:52] mucahitkahveci at gmail dot com

Description:
------------
printf('%f', 55555555555555555555);

prints 55555555555555557376.000000

This number (555...) has 20 digits this happen in any number with more
than 15 digits

Reproduce code:
---------------
printf('%f', 55555555555555555555);

Expected result:
----------------
55555555555555555555.000000

Actual result:
--------------
55555555555555557376.000000


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=47107&edit=1

Reply via email to