.TH MACROS 3 "11 April 1990" .SH NAME IM_RINT, IM_MAX, IM_MIN \- misc math macros .SH SYNOPSIS .B #include int IM_RINT( float ) .br any IM_MAX( any, any ) .br any IM_MIN( any, any ) .SH DESCRIPTION These macros provide some simple but fast math functions --- IM_MAX(3) returns the maximum of its two arguments, IM_MIN(3) the smallest, and IM_RINT(3) rounds a float or double to the nearest integer. Beware: these macros may evaluate their argument more than once, so you MUST NOT use ++,--, or a function call in their argument lists. They are defined as: #define IM_MAX(A,B) ((A)>(B)?(A):(B)) #define IM_MIN(A,B) ((A)<(B)?(A):(B)) #define IM_RINT(R) ((int)((R)>0?((R)+0.5):((R)-0.5))) .SH COPYRIGHT National Gallery, 1993 .SH SEE ALSO im_malloc(3), im_open_local(3). .SH AUTHOR J. Cupitt \- 23/7/93