made "inf" and "nan" tests a little more portable