|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15403 Strange behavior of floor() with negative values
Submitted: 2002-02-06 08:31 UTC Modified: 2002-02-06 08:59 UTC
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: mail at sebastian-bopp dot de Assigned:
Status: Not a bug Package: *Math Functions
PHP Version: 4.1.1 OS: Windows NT
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: mail at sebastian-bopp dot de
New email:
PHP Version: OS:


 [2002-02-06 08:31 UTC] mail at sebastian-bopp dot de
echo floor(1.6); // will output "1"
This is allright...

echo floor(-1.6); // will output "-2"
But shouldn't this one output "-1" instead?



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-02-06 08:59 UTC]
"Returns the next lowest integer ..."

-2 < -1.6 < -1

so -2 is the next lowest integeter, not -1
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 30 13:01:29 2024 UTC