Joseph S. Myers wrote: >> My biggest issue is that I don't see how I can compile-time evaluate the >> following - or how to evaluate it at all: >> >> if (IEEE_SUPPORT_NAN(x)) & ! should be always true (or false) on a >> given system >> > See MODE_HAS_NANS etc. in real.h > Thanks. There I find: - MODE_HAS_NANS - MODE_HAS_INFINITIES - MODE_HAS_SIGNED_ZEROS - MODE_HAS_SIGN_DEPENDENT_ROUNDING
Those match IEEE_SUPPORT_INF, IEEE_SUPPORT_NAN. However, Fortran 2003 has additionally: - IEEE_SUPPORT_ROUNDING (which can be catered for using the presence of fenv.h's FE_DOWNWARD etc.) and also the following items: a) IEEE_SUPPORT_DIVIDE - Inquire whether the processor supports divide with the accuracy specified by the IEEE International Standard. b) IEEE_SUPPORT_DENORMAL - Inquire whether the processor supports IEEE denormalized numbers. c) IEEE_SUPPORT_SQRT - Inquire whether the processor implements SQRT in accord with the IEEE Inter19 national Standard. (In this case, SQRT(-0.0) has the value -0.0.) d) IEEE_SUPPORT_UNDERFLOW_CONTROL - Inquire whether the procedure supports the ability to control the underflow mode during program execution. For the latter four I don't see where I can obtain those pieces of information. Additionally, one is supposed to set (if possible) whether (1) denormal numbers are used or (2) denormals are zero (DAZ); I have not seen an easy option to set/query. (SSE2 seems to allows DAZ, cf.gcc/config/i386/crtfastmath.c) Tobias