> MailingList: contact libcalphahelp@sources.redhat.com; run by ezmlm
> ListUnsubscribe:
> <mailto:libcalphaunsubscribegeoffk=redhat.com@sources.redhat.com>
> ListSubscribe: <mailto:libcalphasubscribe@sources.redhat.com>
> ListArchive: <http://sources.redhat.com/ml/libcalpha/>
> ListPost: <mailto:libcalpha@sources.redhat.com>
> ListHelp: <mailto:libcalphahelp@sources.redhat.com>,
> <http://sources.redhat.com/ml/#faqs>
> Date: Mon, 18 Feb 2002 14:50:30 0500 (EST)
> From: Stephen L Moshier <moshier@moshier.net>
> ReplyTo: moshier@moshier.net
> cc: linuxmips@oss.sgi.com, <libcalpha@sources.redhat.com>
>
>
> > pow(2,7) = 128.0 when rounding = TONEAREST or UPWARD
> > = 64.1547.. when rounding = DOWNWARD or TOWARDZERO
>
> The libm functions from IBM that were recently installed in glibc come
> with this remark in sysdeps/ieee754/dbl64/MathLib.h:
>
> /* Assumption: Machine arithmetic operations are performed in */
> /* round nearest mode of IEEE 754 standard. */
>
> These math functions use a doubledprecision Dekker arithmetic which is
> very sensitive to rounding rules and arithetic flaws. Fixing the
> routines to give reasonable answers with other rounding modes would not
> be practical.
>
> It is customary for a system math library to expect default environment
> conditions, and I do not think this design actually violates any
> standards. If you want to use nondefault arithmetic settings and have
> them work portably on various systems, you will have to take defensive steps
> to protect your program from damage by the operating system and the system
> library.
... actually, C99 seems to imply that all supported rounding
precisions should work for the math library, although of course C99
doesn't promise very much about accuracy of the math library in the
first place.
Maybe we should add appropriate fesetround() calls to the math
library? Usually most of each routine should be done with
roundtonearest and then there's one or two operations at the end
that should be in the user's rounding mode, to get the
correctlyrounded value for the user's rounding mode.

 Geoffrey Keating <geoffk@geoffk.org> <geoffk@redhat.com>
