min()
QNX SDP8.0C Library ReferenceAPIDeveloper
Return the lesser of two numbers
Synopsis:
#include <stdlib.h>
#define min(a,b) …
Arguments:
- a,b
- The numbers that you want to get the lesser of.
Description:
The min() macro returns the lesser of two values.
Note:
The min() macro is for C programs only.
For C++ programs, use the __min() macro.
Examples:
#include <stdio.h>
#include <stdlib.h>
int main( void )
{
int a;
a = min( 1, 10 );
printf( "The value is: %d\n", a );
return EXIT_SUCCESS;
}
Classification:
Safety: | |
---|---|
Cancellation point | No |
Signal handler | Yes |
Thread | Yes |
Page updated: