|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25290 printf produces incorrect result
Submitted: 2003-08-28 07:35 UTC Modified: 2003-08-28 10:14 UTC
From: oli_pla at hotmail dot com Assigned:
Status: Not a bug Package: Strings related
PHP Version: 4.3.3 OS: Windows 2000/XP
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.
Block user comment
Status: Assign to:
Bug Type:
From: oli_pla at hotmail dot com
New email:
PHP Version: OS:


 [2003-08-28 07:35 UTC] oli_pla at hotmail dot com
For some particular values, printf('%.2f',$val) gives incorrect results on Windows 2000 and XP. The behaviour is that a digit is one unit too low. For instance, with 813.54, you get 803.54, and 349.61 becomes 348.61.

On Windows 98 or Linux, the problem doesn't appear.

I'm aware it may be a bug in Microsoft's C runtime, in which case it wouldn't be a PHP problem. But it would be interesting to be sure...

Reproduce code:

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-08-28 10:14 UTC]
Maybe you're mixing some old dlls with news ones (PHP related). This works just fine for me on XP.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Tue Jun 06 15:03:39 2023 UTC