/[hegemonie]/hegemonie/Headers/Common/Math.h
ViewVC logotype

Diff of /hegemonie/Headers/Common/Math.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by el_doc, Fri May 23 12:19:41 2003 UTC revision 1.3 by dam, Sat Aug 23 22:55:50 2003 UTC
# Line 26  Line 26 
26    
27  #include <math.h>  #include <math.h>
28    
29    typedef float real_t;
30    typedef real_t clamp_t;
31    
32    #define MOD(a,max) \
33           ({typeof(a) _MOD_a = (a); typeof(max) _MOD_max = (max); \
34             if (_MOD_a >= _MOD_max || _MOD_a < 0) \
35               _MOD_a = _MOD_a - _MOD_max * (int)(_MOD_a / _MOD_max); \
36             if (_MOD_a < 0) \
37               _MOD_a += _MOD_max; \
38             _MOD_a; })
39    
40  #define SWAP(a,b) \  #define SWAP(a,b) \
41         ({typeof(a) _SWAP_aux = (a); \         ({typeof(a) _SWAP_aux = (a); \
42           (a) = (b); (b) = _SWAP_aux; })           (a) = (b); (b) = _SWAP_aux; })

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26