xref: /freebsd/contrib/gdtoa/gdtoa_fltrnds.h (revision 0b3105a37d7adcadcb720112fed4dc4e8040be99)
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