|
Table 3
Limiting the definition of macros
|
|
Macro name
|
Definition
|
Description
|
|
#define SIGN(x)
|
(((x)>=0) ? (1) : (-1))
|
Sign of variable i
|
|
#define MAX(x, y)
|
(((x) <
(y)) ? (y) : (x))
|
Max of x or y
|
|
#define MIN(x, y)
|
(((x) > (y)) ? (y) : (x))
|
Min of x or y
|
|
#define LIMIT(x,low,high)
|
((x) >(high)?(high):((x)<(low)?(low):(x)))
|
Limit value of x
|
|
Back
|
|
|
|
|
Ready to take that job and shove it?
|
|