Re: [AD] fixceil() weirdness

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


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. Since Allegro stores its fixed numbers by shifting them left by 16, 32768 << 16 == 0x80000000, which is -32768 in fixed point.


--
- Robert J Ohannessian
"Microsoft code is probably O(n^20)" (my CS prof)
http://pages.infinit.net/voidstar/



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/