xref: /freebsd/contrib/gdtoa/gdtoa_fltrnds.h (revision 9f44a47fd07924afc035991af15d84e6585dea4f)
1 	FPI *fpi, fpi1;
2 	int Rounding;
3 #ifdef Trust_FLT_ROUNDS /*{{ only define this if FLT_ROUNDS really works! */
4 	Rounding = Flt_Rounds;
5 #else /*}{*/
6 	Rounding = 1;
7 	switch(fegetround()) {
8 	  case FE_TOWARDZERO:	Rounding = 0; break;
9 	  case FE_UPWARD:	Rounding = 2; break;
10 	  case FE_DOWNWARD:	Rounding = 3;
11 	  }
12 #endif /*}}*/
13 	fpi = &fpi0;
14 	if (Rounding != 1) {
15 		fpi1 = fpi0;
16 		fpi = &fpi1;
17 		fpi1.rounding = Rounding;
18 		}
19