Make ISINF() test safer

Comparing floating point values with "==" or "!=" can be dangerous.