Sender: Christian Tamasiu From: tamasiu AT informatik DOT tu-muenchen DOT de (Christian Tamasiu) Subject: Re: Allegro fixed math routines To: djgpp AT delorie DOT com In-reply-to: Message-Id: <97Feb5.113726+0100_mez.396030-10662+871@hphalle0.informatik.tu-muenchen.de> Date: Wed, 5 Feb 1997 11:37:16 +0100 |> |> Basically you have to remember not to mix ints and fixed values in the |> same statement, with a few exceptions: |> |> When adding, subtracting, and comparing, you must't mix values. |> |> You can multiply or divide a fixed by an int, and you will get a fixed |> result. |> |> To multiply or divide two fixed values, you have to use the fmul() and |> fdiv() functions. |> |> All this can be a big pain to keep track of - it's a _lot_ simpler to |> use floats or the fix class in C++ :-) |> |> /* |> * Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/ |> * Ghoti: 'gh' as in 'enough', 'o' as in 'women', and 'ti' as in 'nation'. |> */ Thanks for clearing this up, I just wasn't aware that the compiler doesn't keep track like it does for the fix class in C++. Chris.