Guardian C Library Calls Reference Manual
Reference to Library Calls
Guardian TNS C Library Calls Reference Manual—128833 3-113
_max (supplementary)
_max (supplementary)
The _max macro expands to the greater of its two arguments.
<arith_type>
is the type of expr1, expr2, and the return value. It can be any arithmetic type.
expr1
is an expression.
expr2
is an expression of the same type as expr1.
Return Value
is the numerically greater of the two arguments, expr1 and expr2.
Usage Guidelines
•
Because _max is a macro, you should avoid specifying expressions with side effects
as arguments.
Example
This example prints “The maximum number is 7.”:
#include <stdlibh>
#include <stdioh>
int main(void)
{
double r, x, y;
x = 5.0;
y = 7.0;
r = _max(x, y);
printf("The maximum number is %f.", r);
}
#include <stdlibh>
<arith_type> _max(<arith_type> expr1, <arith_type> expr2);