Last change
on this file since 6888aa2 was 3ae31e9, checked in by Thomas Lopatic <thomas@…>, 7 years ago |
Imported original source code.
|
-
Property mode
set to
100755
|
File size:
653 bytes
|
Rev | Line | |
---|
[3ae31e9] | 1 | /*
|
---|
| 2 | =============================================================================
|
---|
| 3 | macros.h -- utility macros
|
---|
| 4 | Version 3 -- 1988-10-19 -- D.N. Lynx Crowe
|
---|
| 5 |
|
---|
| 6 | All of the usual comments about side-effects apply.
|
---|
| 7 | =============================================================================
|
---|
| 8 | */
|
---|
| 9 |
|
---|
| 10 | #ifndef abs
|
---|
| 11 | #define abs(x) ((x) < 0 ? -(x) : (x))
|
---|
| 12 | #endif
|
---|
| 13 |
|
---|
| 14 | #ifndef sign
|
---|
| 15 | #define sign(x,y) ((x) < 0 ? -(y) : (y))
|
---|
| 16 | #endif
|
---|
| 17 |
|
---|
| 18 | #ifndef min
|
---|
| 19 | #define min(x,y) ((x) > (y) ? (y) : (x))
|
---|
| 20 | #endif
|
---|
| 21 |
|
---|
| 22 | #ifndef max
|
---|
| 23 | #define max(x,y) ((x) > (y) ? (x) : (y))
|
---|
| 24 | #endif
|
---|
| 25 |
|
---|
| 26 | #ifndef inrange
|
---|
| 27 | #define inrange(var,lo,hi) (((var) >= (lo)) && ((var) <= (hi)))
|
---|
| 28 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.