]> icculus.org git repositories - taylor/freespace2.git/blob - src/math/fix.cpp
added copyright header
[taylor/freespace2.git] / src / math / fix.cpp
1 /*
2  * Copyright (C) Volition, Inc. 1999.  All rights reserved.
3  *
4  * All source code herein is the property of Volition, Inc. You may not sell 
5  * or otherwise commercially exploit the source or things you created based on
6  * the source.
7  */
8
9 /*
10  * $Logfile: /Freespace2/code/Math/Fix.cpp $
11  * $Revision$
12  * $Date$
13  * $Author$
14  *
15  * Code to deal with 16.16 fixed point numbers.
16  *
17  * $Log$
18  * Revision 1.3  2002/06/09 04:41:22  relnev
19  * added copyright header
20  *
21  * Revision 1.2  2002/05/07 03:16:46  theoddone33
22  * The Great Newline Fix
23  *
24  * Revision 1.1.1.1  2002/05/03 03:28:09  root
25  * Initial import.
26  *
27  * 
28  * 2     10/07/98 10:53a Dave
29  * Initial checkin.
30  * 
31  * 1     10/07/98 10:49a Dave
32  * 
33  * 2     2/17/97 5:18p John
34  * Added a bunch of RCS headers to a bunch of old files that don't have
35  * them.
36  *
37  * $NoKeywords: $
38  */
39
40
41 #ifndef PLAT_UNIX
42 #include <windows.h>
43 #endif
44
45 #include "pstypes.h"
46 #include "fix.h"
47
48 fix fixmul(fix a, fix b)
49 {
50         longlong tmp;
51         tmp = (longlong)a * (longlong)b;
52         return (fix)(tmp>>16);
53 }
54
55 fix fixdiv(fix a, fix b)
56 {
57         return MulDiv(a,65536,b);
58 }
59
60 fix fixmuldiv(fix a, fix b,fix c)
61 {
62         return MulDiv(a,b,c);
63 }
64