From: Operating system: PHP version: 5.3.2 Package: Math related Bug Type: Feature/Change Request Bug description:Negating zero does not produce negative zero
Description: ------------ Using the unary negation operator on a float 0 (positive zero) value, simply returns positive zero again, instead of -0 (negative zero), like it does in other languages. var_dump(-(0.)); float(0) The negative zero exists and can be displayed properly, so that is not the problem: var_dump(-1/INF); float(-0) But for some reason there is no easy way to access it. Test script: --------------- var_dump(-(0.)); var_dump(-1/INF); Expected result: ---------------- float(-0) float(-0) Actual result: -------------- float(0) float(-0) -- Edit bug report at http://bugs.php.net/bug.php?id=52355&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=52355&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=52355&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=52355&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=52355&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=52355&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=52355&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=52355&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=52355&r=needscript Try newer version: http://bugs.php.net/fix.php?id=52355&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=52355&r=support Expected behavior: http://bugs.php.net/fix.php?id=52355&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=52355&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=52355&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=52355&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=52355&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=52355&r=dst IIS Stability: http://bugs.php.net/fix.php?id=52355&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=52355&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=52355&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=52355&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=52355&r=mysqlcfg
