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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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: Sat Apr 27 21:01:29 2024 UTC