|  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
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: Mon Jun 17 03:01:28 2024 UTC