php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61524 Incorrect result of printf() with 64-bit value on 32-bit architecture
Submitted: 2012-03-27 08:27 UTC Modified: 2012-03-27 08:57 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: dvzolotarev at gmail dot com Assigned:
Status: Not a bug Package: Variables related
PHP Version: 5.4.0 OS: Debian 6.0.4
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: dvzolotarev at gmail dot com
New email:
PHP Version: OS:

 

 [2012-03-27 08:27 UTC] dvzolotarev at gmail dot com
Description:
------------
Instead 5718813258875302619 output 5718813258875302912

Test script:
---------------
<?php
$a = 5718813258875302619;
printf("%f\n", $a);
?>


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-03-27 08:57 UTC] cataphract@php.net
You're printing it as a float (double precision) and the rounding error is much larger than 1 for such a big number.
 [2012-03-27 08:57 UTC] cataphract@php.net
-Status: Open +Status: Not a bug
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 02 16:01:33 2024 UTC