
John Maddock wrote: Tests run on IRIX Mips Pro 7.4.1m -N32 -mips3 For CC -o classify classify.cpp -lm -I$(BOOST) and CC -O1 -o classify classify.cpp -lm -I$(BOOST) Running 1 test case... FP_ZERO: 0 FP_NORMAL: 1 FP_INFINITE: 2 FP_NAN: 3 FP_SUBNORMAL: 4 Testing type float classify.cpp(130): error in "test_main_caller( argc, argv )": check (::pending::fpclassify)(t) == (int)4 failed [0 != 4] classify.cpp(131): error in "test_main_caller( argc, argv )": check (::pending::fpclassify)(-t) == (int)4 failed [0 != 4] Testing type double classify.cpp(130): error in "test_main_caller( argc, argv )": check (::pending::fpclassify)(t) == (int)4 failed [0 != 4] classify.cpp(131): error in "test_main_caller( argc, argv )": check (::pending::fpclassify)(-t) == (int)4 failed [0 != 4] Testing type long double classify.cpp(130): error in "test_main_caller( argc, argv )": check (::pending::fpclassify)(t) == (int)4 failed [0 != 4] classify.cpp(131): error in "test_main_caller( argc, argv )": check (::pending::fpclassify)(-t) == (int)4 failed [0 != 4] *** 6 failures detected in test suite "Test Program" For CC -O2 -o classify classify.cpp -lm -I$(BOOST) and CC -O3 -o classify classify.cpp -lm -I$(BOOST) Running 1 test case... FP_ZERO: 0 FP_NORMAL: 1 FP_INFINITE: 2 FP_NAN: 3 FP_SUBNORMAL: 4 Testing type float Testing type double Testing type long double *** No errors detected So go figure :-) Optimisation improves the compliance.... bizarre, anyway there are a whole heap of Optimisation options that probably change this behaviour. There is an entire man page for it separate from the main compiler one so I'll look through that to see which ones are important. I belive you can't actually tell at compile time if denormalised are supported like the code is doing I think you need: if (std::numeric_limits<T>::has_denorm == std::denorm_present ) But thats on a brief inspection, may also want to test using denorm_min. Kevin -- | Kevin Wheatley, Cinesite (Europe) Ltd | Nobody thinks this | | Senior Technology | My employer for certain | | And Network Systems Architect | Not even myself |