fmax函数用法详解
fmax函数简介
- 头文件包含
#include <math.h>
- 函数定义
double fmax(double x , double y );
float fmaxf(float x , float y );
long double fmaxl(long double x , long double y );
- 编译链接选项
-lm
fmax函数常见使用错误
- 链接错误
undefined reference to `fmax'
解决办法:添加链接选项
-lm
- 编译错误
warning: implicit declaration of function ‘fmax’ [-Wimplicit-function-declaration]
解决办法:包含头文件
#include <math.h>
fmax函数详细描述
这些函数返回x和y 的较大值
fmax函数返回值
这些函数返回x和y 的最大值
如果一个参数是NaN,则返回另一个参数。
如果两个参数都是NaN,则返回一个NaN。
fmax函数错误码
不会发生错误。
评论区