HUGE is missing in math.h
Richard Earnshaw
rearnsha@gcc.gnu.org
Tue Jun 28 14:43:00 GMT 2005
On Tue, 2005-06-28 at 15:33, Dave Korn wrote:
> ----Original Message----
> >From: Richard Earnshaw
> >Sent: 28 June 2005 15:26
>
> > On Tue, 2005-06-28 at 14:44, Dave Korn wrote:
> >
> >> AFAIUI, IEEE fp is mandated by the ISO C spec, so any system that has a
> >> non-IEEE-compliant long double type needs to be using software fp anyway,
> >> doesn't it? Does newlib care about support for non-ISO-C-compliant
> >> targets?
> >
> > C99 does NOT mandate IEEE fp. It does, however, have an annex (Annex F)
> > that lists a number of features that an IEEE-fp conforming target
> > provides.
>
>
> Ah, thanks for the correction. So, perhaps it would be appropriate to
> define these FP constants by bitwise patterns on IEEE compliant targets, and
> on non-IEEE targets we use the divide-by-zero patterns and hope for the
> best?
You can't even do that. I should have mentioned this last time, but the
problem here is that even a conforming IEEE fp implementation isn't
required to use a conforming extended precision type. Annex F (F.2)
says:
The C floating types match the IEC 60559 formats as follows:
...
- The long double type shall matches an IEC 60559
extended format, else a non-IEC 60559 extended format,
else the IEC 60559 double format.
Any non-IEC 60559 extended format used for the long double type
shall have more precision than IEC 60559 and at least the range
of IEC 60559 double.
So, in fact, you can't even assume that long double will be a strict
IEEE type (though it must have infinity and NaNs).
More information about the Newlib
mailing list