__min
返回小两个值。
type __min(
type a,
type b
);
参数
type
任何数值数据类型。a, b
要比较的任何 numeric 类型的值。
返回值
小两个参数。
备注
__min 宏比较两个值并返回值为较小一个。 参数可以是任何数值数据类型,签名或未签名。 两个参数和返回值必须具有相同的数据类型。
要求
实例 |
必需的头 |
---|---|
__min |
stdlib.h |
示例
// crt_minmax.c
#include <stdlib.h>
#include <stdio.h>
int main( void )
{
int a = 10;
int b = 21;
printf( "The larger of %d and %d is %d\n", a, b, __max( a, b ) );
printf( "The smaller of %d and %d is %d\n", a, b, __min( a, b ) );
}