[openbeos] Re: POSIX headers

  • From: Ingo Weinhold <bonefish@xxxxxxxxxxxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Wed, 17 Sep 2003 21:07:02 +0200

On 2003-09-17 at 20:25:36 [+0200], Adi Oanca wrote:
> ...forgot about round(). But then again... we don't have such a function.
> :-)
> 
> From: "Adi Oanca" <e2joseph@xxxxxxxxxx>
> > From: "Matthijs Hollemans"> > Why do we use our POSIX headers, if they are
> > not completely
> > > > functional?
> > > > for example I want to use 'lroundf()' function found in math.h.
> > >
> > > According to a quick Google search I just did, lroundf() was added to
> the
> > > C99 standard. I don't think our version of gcc supports that standard,
> or
> > > does it?
> > >
> > > Then again, R5 only supports a fraction of POSIX anyway.
> >
> >     OK, be it like so.
> >
> >     Please tell me: how can I have a float's rounded value in an int32...
> >         float    y = 3.14f;
> >         int32   z = (int32)round( y );
> >             ... without a compiler warning?

I wonder, what is the warning you get? It looks like perfectly legal code to 
me. Or are you referring to the `implicit declaration...' error?
I wonder, why round() isn't declared for x86 in the R5 <math.h> header. The 
symbol is in libroot and it seems to work, too.

CU, Ingo

Other related posts: