Yes. Division works on all numbers but 0.0 and -0.0. So this would make sense:
if (f) f = 1.0/f; else ...
(When it comes to division I'd prefer to get Math.inf or -Math.inf instead of exceptions, though.)
/ Martin Stjernholm, Roxen IS
Previous text:
2003-09-18 21:24: Subject: float type weirdness
0.0 was intentionally left out. Floats are not to be used as boolean values. It also underlines the fact that floats are not ints. Originally, the integer zero was supposed to be the only false value.
With a float, is there even a precise way to determine weather a value is zero or not?
/ Fredrik (Naranek) Hubinette (Real Build Master)