php-documentation-list | 2003101
Date: 10/09/03
- Next message: didou <email protected>: "[PHP-DOC] #25802 [Opn->Bgs]: User Notes inaccurate"
- Previous message: wonglow at yahoo dot com: "[PHP-DOC] #25801 [NEW]: User Notes inaccurate"
- Next in thread: didou <email protected>: "[PHP-DOC] #25802 [Opn->Bgs]: User Notes inaccurate"
- Reply: didou <email protected>: "[PHP-DOC] #25802 [Opn->Bgs]: User Notes inaccurate"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: didou <email protected>: "[PHP-DOC] #25802 [Opn->Bgs]: User Notes inaccurate"
- Previous message: wonglow at yahoo dot com: "[PHP-DOC] #25801 [NEW]: User Notes inaccurate"
- Next in thread: didou <email protected>: "[PHP-DOC] #25802 [Opn->Bgs]: User Notes inaccurate"
- Reply: didou <email protected>: "[PHP-DOC] #25802 [Opn->Bgs]: User Notes inaccurate"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

