2010-06-03 21:24:43 +08:00
|
|
|
/*********************************************************************
|
2018-12-07 06:36:53 +08:00
|
|
|
* Copyright 2018, University Corporation for Atmospheric Research
|
2010-06-03 21:24:43 +08:00
|
|
|
* See netcdf/README file for copying and redistribution conditions.
|
2018-01-18 00:20:20 +08:00
|
|
|
* Russ Rew
|
2010-06-03 21:24:43 +08:00
|
|
|
*********************************************************************/
|
2018-01-18 00:20:20 +08:00
|
|
|
#ifndef _ISNAN_H
|
|
|
|
#define _ISNAN_H
|
2010-06-03 21:24:43 +08:00
|
|
|
|
2017-03-09 08:01:10 +08:00
|
|
|
#include "config.h"
|
2010-06-03 21:24:43 +08:00
|
|
|
|
|
|
|
#ifndef NO_FLOAT_H
|
|
|
|
#include <float.h> /* for DBL_MAX */
|
|
|
|
#endif /* NO_FLOAT_H */
|
|
|
|
#include <math.h>
|
|
|
|
|
2020-08-18 09:15:47 +08:00
|
|
|
#ifndef NAN
|
|
|
|
#error "NAN undefined"
|
|
|
|
#endif
|
|
|
|
#ifndef INFINITY
|
|
|
|
#error "INFINITY undefined"
|
|
|
|
#endif
|
|
|
|
#ifndef NANF
|
|
|
|
#define NANF ((float)NAN)
|
|
|
|
#endif
|
|
|
|
#ifndef INFINITYF
|
|
|
|
#define INFINITYF ((float)INFINITY)
|
|
|
|
#endif
|
2010-06-03 21:24:43 +08:00
|
|
|
#if ! (defined(isinf) || HAVE_DECL_ISINF)
|
|
|
|
#define isinf(x) (DBL_MAX/((double)(x))==0.0)
|
|
|
|
#endif /* !HAVE_DECL_ISINF */
|
|
|
|
#if ! (defined(isnan) || HAVE_DECL_ISNAN)
|
|
|
|
#define isnan(x) ((x)!=(x))
|
|
|
|
#endif /* !HAVE_DECL_ISNAN */
|
|
|
|
#if ! (defined(isfinite) || HAVE_DECL_ISFINITE)
|
|
|
|
#define isfinite(x) (!(isinf(x)||isnan(x)))
|
|
|
|
#endif /* !HAVE_DECL_ISFINITE */
|
2018-01-18 00:20:20 +08:00
|
|
|
|
|
|
|
#endif /* _ISNAN_H */
|