HUGE is missing in math.h

Richard Earnshaw rearnsha@gcc.gnu.org
Tue Jun 28 16:43:00 GMT 2005


On Tue, 2005-06-28 at 17:01, Dave Korn wrote:
>  Hmmm.  I need some more head-scratching time on this one.  The standard
> certainly allows that, but presumably it also require the behaviour to be
> the same regardless of whether we evaluate the expression at runtime or at
> compiletime?  We may be introducing dependencies on the inner details of
> compiler behaviour if we're not careful here.

I can't put my finger on the quote off-hand, but I seem to recall
reading that the compiler is supposed to evaluate constant expressions
in the default rounding mode.  If the application doesn't change the
mode, then the results should be the same; but there's no guarantee that
this will be so if the rounding is changed.

>   Is glibc allowed to assume
> that it's being compiled by gcc / running with gcc-compiled code?

It's probably reasonable to assume that glibc will be compiled with gcc
these days.  But it's certainly unreasonable to assume that any code
linked to it will be.

R.



More information about the Newlib mailing list