]> icculus.org git repositories - taylor/freespace2.git/blob - src/math/fix.cpp
Initial revision
[taylor/freespace2.git] / src / math / fix.cpp
1 /*
2  * $Logfile: /Freespace2/code/Math/Fix.cpp $
3  * $Revision$
4  * $Date$
5  * $Author$
6  *
7  * Code to deal with 16.16 fixed point numbers.
8  *
9  * $Log$
10  * Revision 1.1  2002/05/03 03:28:09  root
11  * Initial revision
12  *
13  * 
14  * 2     10/07/98 10:53a Dave
15  * Initial checkin.
16  * 
17  * 1     10/07/98 10:49a Dave
18  * 
19  * 2     2/17/97 5:18p John
20  * Added a bunch of RCS headers to a bunch of old files that don't have
21  * them.
22  *
23  * $NoKeywords: $
24  */
25
26
27 #ifndef PLAT_UNIX
28 #include <windows.h>
29 #endif
30
31 #include "pstypes.h"
32 #include "fix.h"
33
34 fix fixmul(fix a, fix b)
35 {
36         longlong tmp;
37         tmp = (longlong)a * (longlong)b;
38         return (fix)(tmp>>16);
39 }
40
41 fix fixdiv(fix a, fix b)
42 {
43         return MulDiv(a,65536,b);
44 }
45
46 fix fixmuldiv(fix a, fix b,fix c)
47 {
48         return MulDiv(a,b,c);
49 }