#31870 [NEW]: rounding negative numbers gives "-0"

From: Date: Mon, 07 Feb 2005 12:08:50 +0000
Subject: #31870 [NEW]: rounding negative numbers gives "-0"
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-73592@lists.php.net to get a copy of this message
From: amir at foresthc dot com Operating system: Debian woody PHP version: 5.0.3 PHP Bug Type: *General Issues Bug description: rounding negative numbers gives "-0" Description: ------------ When rounding real negative numbers that should round to zero, the result is -0 (minus zero). This isn't a critical bug, but it's a nusanse hunting these down in places were the output reaches the user. Reproduce code: --------------- echo round(-0.1); Expected result: ---------------- 0 Actual result: -------------- -0 -- Edit bug report at http://bugs.php.net/?id=31870&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=31870&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=31870&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=31870&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=31870&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=31870&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=31870&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=31870&r=needscript Try newer version: http://bugs.php.net/fix.php?id=31870&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=31870&r=support Expected behavior: http://bugs.php.net/fix.php?id=31870&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=31870&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=31870&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=31870&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=31870&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=31870&r=dst IIS Stability: http://bugs.php.net/fix.php?id=31870&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=31870&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=31870&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=31870&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=31870&r=mysqlcfg

« previous php.bugs (#73592) next »