Commit c15ada90 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Replaced isnan() by std::isnan().

parent fd3dba10
......@@ -3,6 +3,10 @@
* Using CDI library version 1.9.3
* Version 1.9.3 release
2018-01-25 Uwe Schulzweida
* Replaced isnan() by std::isnan()
2018-01-22 Uwe Schulzweida
*expr: added function cday(), cmonth(), cyear(), csecond(), cminute(), chour()
......
......@@ -27,6 +27,7 @@
pp. 559-570
*/
#include <cmath>
#include <cdi.h>
#include "cdo.h"
#include "statistic.h"
......@@ -461,7 +462,7 @@ void *Ensval(void *argument)
for ( stream =0; stream<nostreams; stream++ ) {
pstreamDefRecord(streamID2[stream],varID,levelID);
if ( isnan ( r[stream] ) ) {
if ( std::isnan(r[stream]) ) {
r[stream] = missval;
have_miss = 1;
}
......
......@@ -31,6 +31,7 @@
#endif
#include <cmath>
#include <cdi.h>
#include "cdo.h"
#include "cdo_int.h"
......@@ -159,10 +160,10 @@ void *Setmiss(void *argument)
else if ( operatorID == SETCTOMISS )
{
#if defined(HAVE_ISNAN)
if ( isnan(rconst) )
if ( std::isnan(rconst) )
{
for ( size_t i = 0; i < gridsize; i++ )
if ( isnan(array[i]) )
if ( std::isnan(array[i]) )
{
array[i] = missval;
nmiss++;
......
......@@ -15,13 +15,7 @@
GNU General Public License for more details.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <errno.h>
#include <ctype.h>
#include <assert.h>
#include <cmath>
#include <cdi.h>
#include "cdo.h"
......@@ -891,7 +885,7 @@ nodeType *ex_fun_var(int init, int funcID, nodeType *p1)
errno = -1;
pdata[i] = DBL_IS_EQUAL(p1data[i], missval) ? missval : exprfunc(p1data[i]);
if ( errno == EDOM || errno == ERANGE ) pdata[i] = missval;
else if ( isnan(pdata[i]) ) pdata[i] = missval;
else if ( std::isnan(pdata[i]) ) pdata[i] = missval;
}
}
else
......@@ -901,7 +895,7 @@ nodeType *ex_fun_var(int init, int funcID, nodeType *p1)
errno = -1;
pdata[i] = exprfunc(p1data[i]);
if ( errno == EDOM || errno == ERANGE ) pdata[i] = missval;
else if ( isnan(pdata[i]) ) pdata[i] = missval;
else if ( std::isnan(pdata[i]) ) pdata[i] = missval;
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment