delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/05/05:47:07

Sender: Christian Tamasiu <tamasiu AT informatik DOT tu-muenchen DOT de>
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: <Yne1OUA4B59yEwpC@talula.demon.co.uk>
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.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019