error: 'isinf' or 'isnan' or 'iserr' was not declared in this scope问题解决

来源:互联网 发布:@Requestbody解析json 编辑:程序博客网 时间:2024/05/21 19:45

error: 'isinf' or 'isnan' or 'iserr' was not declared in this scope问题解决


        在windows下:

 _isnan(x)!_finite(x)

        在linux下:

isnan(x) isinf(x)

        为了跨平台,应添加如下代码:

int isnan(double x) { return x != x; }int isinf(double x) { return !isnan(x) && isnan(x - x); }int iserr(double x) {return isnan(x)||isinf(x);}

0 0
原创粉丝点击