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);}