I agree, Math.inf would be better. I still prefer if(f != 0.0) over if(f) though. When I read this code, I see "if f is a float, divide, otherwise..."
/ Fredrik (Naranek) Hubinette (Real Build Master)
Previous text:
2003-09-18 21:42: Subject: float type weirdness
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