]> icculus.org git repositories - taylor/freespace2.git/blob - src/math/fix.cpp
The Great Newline Fix
[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.2  2002/05/07 03:16:46  theoddone33
11  * The Great Newline Fix
12  *
13  * Revision 1.1.1.1  2002/05/03 03:28:09  root
14  * Initial import.
15  *
16  * 
17  * 2     10/07/98 10:53a Dave
18  * Initial checkin.
19  * 
20  * 1     10/07/98 10:49a Dave
21  * 
22  * 2     2/17/97 5:18p John
23  * Added a bunch of RCS headers to a bunch of old files that don't have
24  * them.
25  *
26  * $NoKeywords: $
27  */
28
29
30 #ifndef PLAT_UNIX
31 #include <windows.h>
32 #endif
33
34 #include "pstypes.h"
35 #include "fix.h"
36
37 fix fixmul(fix a, fix b)
38 {
39         longlong tmp;
40         tmp = (longlong)a * (longlong)b;
41         return (fix)(tmp>>16);
42 }
43
44 fix fixdiv(fix a, fix b)
45 {
46         return MulDiv(a,65536,b);
47 }
48
49 fix fixmuldiv(fix a, fix b,fix c)
50 {
51         return MulDiv(a,b,c);
52 }
53