Re: [AD] fixceil() weirdness |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Bob wrote:
> Sven Sandberg wrote:
> > Hello,
> > Why does fixceil() set errno if the argument is bigger than 32767?
> > 32768 certainly fits in an int. Is this a mistake or was it made
> > deliberately for some reason?
>
> I'm assuming you mean itofix(32768) and not just 32768.
Yes.
> Since Allegro stores
> its fixed numbers by shifting them left by 16, 32768 << 16 ==
> 0x80000000, which is -32768 in fixed point.
Yes, but fixceil() returns int, not fixed.
I.e., fixceil(0x7fff****) currently sets errno and returns 0x7fff, but I
think it should return 0x8000.
--
Sven Sandberg svsa1977@xxxxxxxxxx home.student.uu.se/svsa1977