Edit report at http://bugs.php.net/bug.php?id=52355&edit=1

 ID:              52355
 User updated by: spoon dot reloaded at gmail dot com
 Reported by:     spoon dot reloaded at gmail dot com
 Summary:         Negating zero does not produce negative zero
 Status:          Open
 Type:            Feature/Change Request
 Package:         Math related
 PHP Version:     5.3.2

 New Comment:

Nor can you specify -0 as a float literal:

var_dump(-0.);

float(0)


Previous Comments:
------------------------------------------------------------------------
[2010-07-16 08:31:54] spoon dot reloaded at gmail dot com

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 this bug report at http://bugs.php.net/bug.php?id=52355&edit=1

Reply via email to