1 #include <float.h> 2 #include <fenv.h> 3 __flt_rounds()4int __flt_rounds() 5 { 6 switch (fegetround()) { 7 #ifdef FE_TOWARDZERO 8 case FE_TOWARDZERO: return 0; 9 #endif 10 case FE_TONEAREST: return 1; 11 #ifdef FE_UPWARD 12 case FE_UPWARD: return 2; 13 #endif 14 #ifdef FE_DOWNWARD 15 case FE_DOWNWARD: return 3; 16 #endif 17 } 18 return -1; 19 } 20