Commit 1efe06db authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

nint: check function round().

parent 9d58937b
......@@ -71,6 +71,8 @@ void *Math(void *argument)
int operatorID = cdoOperatorID();
int operfunc = cdoOperatorF1(operatorID);
if ( operfunc == FNINT ) cdo_check_round();
double rc = 0;
if ( operfunc == POW )
{
......
......@@ -879,3 +879,12 @@ void minmaxval(long nvals, double *array, int *imiss, double *minval, double *ma
*minval = xmin;
*maxval = xmax;
}
void cdo_check_round(void)
{
double rval1 = round(1.45678921);
double rval2 = round(1.54678921);
if ( IS_NOT_EQUAL(rval1, 1.) || IS_NOT_EQUAL(rval2, 2.) )
cdoAbort("Function round() produces wrong results!");
}
......@@ -229,4 +229,6 @@ void printLibraries(void); // features.c
int wildcardmatch(const char *w, const char *s);
void cdo_check_round(void);
#endif /* _UTIL_H */
Supports Markdown
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