{
int ret = 0;
- if ((range->min != NAN) && (range->min > value))
+ if (!isnan (range->min) && (range->min > value))
ret = 1;
- if ((range->max != NAN) && (range->max < value))
+ if (!isnan (range->max) && (range->max < value))
ret = 1;
return (((ret - range->invert) == 0) ? 0 : 1);
for (i = 0; i < values_num; i++)
{
- if (values[i] == NAN)
+ if (isnan (values[i]))
num_warning++;
else if (match_range (&range_critical_g, values[i]) != 0)
num_critical++;
total_num = 0;
for (i = 0; i < values_num; i++)
{
- if (values[i] != NAN)
+ if (!isnan (values[i]))
{
total += values[i];
total_num++;
total_num = 0;
for (i = 0; i < values_num; i++)
{
- if (values[i] != NAN)
+ if (!isnan (values[i]))
{
total += values[i];
total_num++;
#include "utils_debug.h"
/*
- * This weird macro cascade forces the glibc to define `NAN'. I don't know
- * another way to solve this, so more intelligent solutions are welcome. -octo
- */
-#ifndef __USE_ISOC99
-# define DISABLE__USE_ISOC99 1
-# define __USE_ISOC99 1
-#endif
-#include <math.h>
-#ifdef DISABLE__USE_ISOC99
-# undef DISABLE__USE_ISOC99
-# undef __USE_ISOC99
-#endif
-
-/*
* Private types
*/
struct rrd_cache_s
break;
}
- if (d->min == NAN)
+ if (isnan (d->min))
{
strcpy (min, "U");
}
min[sizeof (min) - 1] = '\0';
}
- if (d->max == NAN)
+ if (isnan (d->max))
{
strcpy (max, "U");
}
vc->counter[i] = 0;
}
- if ((vc->gauge[i] == NAN)
- || ((ds->ds[i].min != NAN) && (vc->gauge[i] < ds->ds[i].min))
- || ((ds->ds[i].max != NAN) && (vc->gauge[i] > ds->ds[i].max)))
+ if (isnan (vc->gauge[i])
+ || (!isnan (ds->ds[i].min) && (vc->gauge[i] < ds->ds[i].min))
+ || (!isnan (ds->ds[i].max) && (vc->gauge[i] > ds->ds[i].max)))
vc->gauge[i] = NAN;
} /* for i = 0 .. ds->ds_num */
for (i = 0; i < vc->values_num; i++)
{
fprintf (fh, " %s=", vc->ds->ds[i].name);
- if (vc->gauge[i] == NAN)
+ if (isnan (vc->gauge[i]))
fprintf (fh, "NaN");
else
fprintf (fh, "%12e", vc->gauge[i]);