IEEE floating point numbers have a bit assigned to indicate the sign, which means you can technically have different binary representations of zero (+0 and -0). Is there an
You should exercise caution when doing equality comparisons using floats. Remember, you're trying to represent a decimal value in a binary system.
Is it safe to check floating point values for equality to 0?
If you must compare floating point values I would suggest you use some kind of tolerance that is acceptable to you float1 <= toleranceVal && float1 >= toleranceVal2 or multiply by some factor of ten and cast as an integer.
if (!(int)(float1 * 10000)) { .. some stuff .. }