|
From: Stefan H. <st...@to...> - 2009-04-27 19:35:17
|
>Stefan Huber wrote: > >>> At least nan, inf, etc. do not work (correctly) when __FAST_MATH__ is on. >>> Please tell me more. How do they work differently when it is off? >> >> About two years ago I ported an app that relies on nan, etc. from CW >> to Xcode. The main problem is (as far as I remember) that isnan, >> isinf and similar functions always return false if __FAST_MATH__ is >> on. Quesa does not use these functions. >> >> BTW CWs "Relaxed IEEE Floating Point" setting works perfectly well with nan. > >Quesa does use isfinite, and I'm sure I would have noticed if it wasn't >working... rendering with shadows requires an infinite yon, and >E3ViewAngleAspectCamera::GetFrustumMatrix uses isfinite to do the right >thing in that case. I've tested __FAST_MATH__ is on for floats again (Xcode 2.4.1): you are right : isfinite and isinf work correctly for std::numeric_limits<float>::infinity() but: isnan returns 0 (instead of 1) and isfinite returns 1 (instead of 0) for std::numeric_limits<float>::quiet_NaN() It seems that inf works but nan does not. Stefan http://www.topoi.ch |