This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
Re: HUGE is missing in math.h
On Jun 28 11:25, Dave Korn wrote:
> >From: Ralf Corsepius
> > On Tue, 2005-06-28 at 09:52 +0200, Corinna Vinschen wrote:
> >> Would it be a problem to use the Mingw definitions?
> >>
> >> #define NAN (0.0F/0.0F)
> >> #define HUGE_VALF (1.0F/0.0F)
> >> #define HUGE_VALL (1.0L/0.0L)
> >> #define INFINITY (1.0F/0.0F)
> >
> > Are you sure none of these "divisions by zero" doesn't result into an
> > exception on some architectures?
No, I'm not. I assumed that the compiler would just do the right thing.
> I don't have a copy of the 754 standard, but IIRC it clearly defines the
> representations of (at least some of) these various constants in terms of
> bit-patterns in the various fields (s/e/m) of the fp type, and shouldn't we
> just implement those as hex constants of the appropriate target-dependent
> endian-ness, which should be a thoroughly cross-platform solution? (I'll
> see if I can find a copy of the standard online anywhere to study.)
I guess we could use the constants used in the glibc implementation?
I'm just not sure how far constant values might be covered by the license.
Corinna
--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat, Inc.