[A83] Re: A call to those who think they know more than me.
[Prev][Next][Index][Thread]
[A83] Re: A call to those who think they know more than me.
In accordance with the prophecy, Kirk Meyer uttered:
> _inline fixedpoint_t fpm_Ceil(fixedpoint_t fxp) {
> if (fxp <= 0) return fxp & 0xffff0000;
> else return ((fxp - 1) | 0x0000ffff) + 1;
> }
May I suggest the following code to round positive numbers upwards:
return (fxp + 0xffff) & ~0xffff;
The remaining cases are left as an exercise, yadda yadda yadda.
Linus
--------------------------------------------- http://www.df.lth.se/~lft ---
haiku's inventor
must have had seven fingers
on his middle hand
References: