[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Conflicts between C standard and 754-2008

Unless I couldn't figure out how to use fesetround(FE_TOWARDZERO), it
appears that Linux (with gcc version 4.3.2) strtod() does not honour
the rounding direction at all:

   <175: 74 => ./td 0.1 1
   rc from fesetround(rm): 0  rm=3072
   td: 3FB99999 9999999A      3 status=0000  0.1

   <175: 82 => uname -r -m x86_64

(The same program under AIX returns ...999 for TOWARDZERO
and ...99A for NEAREST, as expected.  It does however return
Infinity for overflow regardless of rounding mode, guided by
the not-yet-revised C standard.)

---Sent: 2011-01-01 22:41:33 UTC

754 | revision | FAQ | references | list archive