#25802 [NEW]: User Notes inaccurate
| From: | wonglow at yahoo dot com | Date: | Thu, 09 Oct 2003 09:34:20 +0000 |
| Subject: | #25802 [NEW]: User Notes inaccurate | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969356553@lists.php.net to get a copy of this message | ||
From: wonglow at yahoo dot com
Operating system: any
PHP version: Irrelevant
PHP Bug Type: Documentation problem
Bug description: User Notes inaccurate
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.
--
Edit bug report at http://bugs.php.net/?id=25802&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=25802&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=25802&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=25802&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=25802&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=25802&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=25802&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=25802&r=support
Expected behavior: http://bugs.php.net/fix.php?id=25802&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=25802&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=25802&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=25802&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25802&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=25802&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=25802&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=25802&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=25802&r=float