Mail Archives: djgpp/1997/02/04/20:29:11
On Tue, 4 Feb 1997 13:10:19 +0100 (MEZ) Christian Tamasiu
<tamasiu AT informatik DOT tu-muenchen DOT de> writes:
>Hello!
>I just hacked in a small program which uses the fixed math routines of
>allegro. However, some strange things are going on (at least thats
>what it
>seems to be for me):
>Why doesnt, for example, " x = y + 24 " (both x and y fixed) work???
>However, " x = y + itofix(24) " worked. But even more strange using
>some
>other values, it worked without itofix. It is also sometimes need
>using
>*,/,- and sometimes not.
>Why???
>Chris.
>
>
I'd have to see the code to know for sure, but here's the general gist:
FIXED + FIXED = a+b
FIXED - FIXED = a-b
FIXED * FIXED = fmul(a,b)
FIXED / FIXED = fdiv(a,b)
FIXED + INTEGER = a+itofix(b)
FIXED - INTEGER = a-itofix(b)
FIXED * INTEGER = a*b
FIXED / INTEGER = a/b
...Chambers
- Raw text -