php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5500 Round() precision doesn?t work
Submitted: 2000-07-11 04:25 UTC Modified: 2000-07-14 20:49 UTC
From: marten at jerbro dot se Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 4.0 Latest CVS (11/07/2000) OS: Linux - Debian Slink
Private report: No CVE-ID: None
 [2000-07-11 04:25 UTC] marten at jerbro dot se
If the php.ini precision directive is set to 18 or more, second argument to round() stops working.


<?
echo round(1.95583, 2);  // Should output 1.96
?>

Snippet outputs: 1.9599999999999999645

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-14 20:49 UTC] sterling at cvs dot php dot net
That's because you've set the precision level higher than PHP's types can hold.  Not a bug.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jul 24 06:01:30 2024 UTC