|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49214 Print floating
Submitted: 2009-08-10 20:49 UTC Modified: 2009-08-11 09:08 UTC
From: leeja120 at gmail dot com Assigned:
Status: Not a bug Package: Output Control
PHP Version: 5.2SVN-2009-08-10 (snap) OS: windows xp
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
30 - 8 = ?
Subscribe to this entry?

 [2009-08-10 20:49 UTC] leeja120 at gmail dot com
Print floating

Reproduce code:

echo 946744073709551614;


Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-08-11 07:05 UTC] sjoerd-php at linuxonly dot nl
Thank you for your report.

The behavior you describe, although it is somewhat strange, is not a bug. It is documented:

"If PHP encounters a number beyond the bounds of the integer  type, it will be interpreted as a float instead."

"The size of a float is platform-dependent, although a maximum of ~1.8e308 with a precision of roughly 14 decimal digits is a common value (the 64 bit IEEE format)."
 [2009-08-11 09:08 UTC]
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:
Thank you for your interest in PHP.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 22 07:01:34 2024 UTC