For what values of x does the test (x == 0) return true? Is there some kind of margin or does the test return true if and only if the value of x = 0?
When Math.signum(x)
== 0.
All other attempts to check whether float x
== 0 may fail.
But Math.signum() is so basic, it should never fail.