php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #25801 User Notes inaccurate
Submitted: 2003-10-09 05:31 UTC Modified: 2003-10-09 06:03 UTC
From: wonglow at yahoo dot com Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS: any
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.
Password:
Status:
Package:
Bug Type:
Summary:
From: wonglow at yahoo dot com
New email:
PHP Version: OS:

 

 [2003-10-09 05:31 UTC] wonglow at yahoo dot com
Description:
------------
A note added at "http://www.php.net/manual/en/function.round.php" is inaccurate

limit0.com
17-Aug-2003 09:58 
Here is how to always round up...
$x = (a/b);
$r = round($x);
$d = ($x-$r);

if ($d>0){
$x = ($r+1);
}
.....


The result above will not always round up variable $x.
e.g If $x=0.6777
then $r = 1 and $d = -0.3223
Since $d < 0
$x is still 0.6777. It never round up ,except if $x < 0.5. 
I believe ceil() is doing a good job.



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-10-09 06:03 UTC] didou@php.net
Hello,

notes != documentation, so please don't submit bugs about them.

Mehdi

PS : the note was deleted
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 10:01:29 2024 UTC