www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/04/20:29:11

To: djgpp AT delorie DOT com
Subject: Re: Allegro fixed math routines
Message-ID: <19970204.171826.4847.3.chambersb@juno.com>
References: <Pine DOT HPP DOT 3 DOT 95 DOT 970204130243 DOT 29841F-100000 AT hphalle7i DOT informatik DOT tu-muenchen DOT de>
From: chambersb AT juno DOT com (Benjamin D Chambers)
Date: Tue, 04 Feb 1997 20:17:04 EST

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 -


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