Is it possible to check if a float is a positive zero (0.0) or a negative zero (-0.0)?
float
I\'ve converted the float to a String a
String
Yes, divide by it. 1 / +0.0f is +Infinity, but 1 / -0.0f is -Infinity. It's easy to find out which one it is with a simple comparison, so you get:
1 / +0.0f
+Infinity
1 / -0.0f
-Infinity
if (1 / x > 0) // +0 here else // -0 here
(this assumes that x can only be one of the two zeroes)
x