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
The approach used by Math.min is similar to what Jesper proposes but a little clearer:
Math.min
private static int negativeZeroFloatBits = Float.floatToRawIntBits(-0.0f); float f = -0.0f; boolean isNegativeZero = (Float.floatToRawIntBits(f) == negativeZeroFloatBits);