Bug #61524 [Opn->Nab]: Incorrect result of printf() with 64-bit value on 32-bit architecture
| From: | cataphract@php.net | Date: | Tue, 27 Mar 2012 08:57:49 +0000 |
| Subject: | Bug #61524 [Opn->Nab]: Incorrect result of printf() with 64-bit value on 32-bit architecture | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-168862@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=61524&edit=1
ID: 61524
Updated by: cataphract@php.net
Reported by: dvzolotarev at gmail dot com
Summary: Incorrect result of printf() with 64-bit value on
32-bit architecture
-Status: Open
+Status: Not a bug
Type: Bug
Package: Variables related
Operating System: Debian 6.0.4
PHP Version: 5.4.0
Block user comment: N
Private report: N
New Comment:
You're printing it as a float (double precision) and the rounding error is much larger than 1
for such a big number.
Previous Comments:
------------------------------------------------------------------------
[2012-03-27 08:27:45] dvzolotarev at gmail dot com
Description:
------------
Instead 5718813258875302619 output 5718813258875302912
Test script:
---------------
<?php
$a = 5718813258875302619;
printf("%f\n", $a);
?>
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=61524&edit=1