当前位置: C语言 -- 标准库 -- <math.h> -- fmaximuml

fmaximuml函数


概要:
#include <math.h>
long double fmaximuml(long double x, long double y);

描述:

该函数确定其参数的较大值。

对于该函数,+0视为大于-0。如果存在非数值参数,该函数返回非数值,且不会引发浮点异常。

fmaximuml函数和fmaximum_numl函数类似,唯一的区别在于非数值参数的处理:如果存在一个非数值参数,fmaximuml函数返回非数值;fmaximum_numl函数返回数值。


参数:
long double x

参数为long double类型的浮点数。

long double y

参数为long double类型的浮点数。


返回值:

函数返回其参数的较大值。


范例:
1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
17 
/*函数fmaximuml范例*/

#include <math.h>
#include <stdio.h>

int main(void)
{
    #if __STDC_VERSION_MATH_H__ >= 202311L
        printf("fmaximuml(8.0L, 2.0L) = %.2Lf\n", fmaximuml(8.0L, 2.0L));
        printf("fmaximuml(-8.0L, -2.0L) = %.2Lf\n", fmaximuml(-8.0L, -2.0L));
    #else
        puts("The implementation does not support fmaximuml function.");
    #endif

    return 0;
}

输出:

The implementation does not support fmaximuml function.


相关内容:
fmaximum double类型的确定较大值函数。
fmaximumf float类型的确定较大值函数。
fmaximumd32 _Decimal32类型的确定较大值函数。
fmaximumd64 _Decimal64类型的确定较大值函数。
fmaximumd128 _Decimal128类型的确定较大值函数。


主要参考资料:

1、ISO/IEC 9899:2024