php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24342 Failure in float operations
Submitted: 2003-06-26 05:32 UTC Modified: 2003-06-26 10:51 UTC
From: hostmaster at bemarnet dot es Assigned:
Status: Not a bug Package: Math related
PHP Version: 4.3.2 OS: Gentoo Linux
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:
MUST BE VALID
Solve the problem:
24 + 10 = ?
Subscribe to this entry?

 
 [2003-06-26 05:32 UTC] hostmaster at bemarnet dot es
Description:
------------
Float operations (sprintf, number_format, etc..) fail.

Reproduce code:
---------------
<?
 
  $num = 57.4523;    
  echo "1 : $num<br>";   
  echo "2 : ".sprintf("%2.02f", $num)."<br>";   
  echo "3 : ".number_format($num,2,'.',',');   
 
?>

Expected result:
----------------
1 : 57.4523
2 : 57.45
3 : 57.45


Actual result:
--------------
1 : 57.4523
2 : i.00
3 : i00 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-06-26 06:28 UTC] hostmaster at bemarnet dot es
I have also tested with the latest revision (4.3.2-r2 dated 25 June)
 [2003-06-26 10:51 UTC] iliaa@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

Over optimization by gentoo can often result of corruption of floats. This is not a php bug.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Oct 30 14:01:24 2020 UTC