This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
Re: SUSv2: Can we have MAXFLOAT in <math.h> ?
"J. Johnston" wrote:
>
> "H. Peter Anvin" wrote:
> >
> > Shawn Behrens wrote:
> > > Hi,
> > >
> > >> Shawn Behrens wrote:
> > >> > SUSv2 specifies that MAXFLOAT be part of math.h. See here:
> > >> > http://www.opengroup.org/onlinepubs/007908799/xsh/math.h.html
> > >> >
> > >> > Could that be added, please? Like this, for example:
> > >> >
> > >> > #define MAXFLOAT ((float)3.40282346638528860e+38)
> > >> >
> > >>
> > >> /* math.h */
> > >>
> > >> #include <limits.h>
> > >> #define MAXFLOAT FLT_MAX
> > >>
> > >> ... presumably?
> > >
> > >
> > > Hmm. So you'd have math.h include limits.h ? I'm not sure, is that
> > > "kosher"? (When I say "I am not sure", I mean it.)
> > >
> > > What I am thinking about is "getting more than you bargained for" ... I
> > > am entirely uncertain as to what SUSv2 or ISO-C (99?) says about pulling
> > > header Y in when you include header X in your program.
> > >
> >
> > It's apparently *not* kosher according to POSIX.1:2001/SuSv3. Perhaps
> > the value can be extracted mechanically?
> >
> > -hpa
>
> There should be no problem just adding the value to math.h like glibc does.
> I will do so shortly.
>
Done.
-- Jeff J.