File: isnan.h

package info (click to toggle)
netcdf-parallel 1%3A4.9.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 113,164 kB
  • sloc: ansic: 267,893; sh: 12,869; cpp: 5,822; yacc: 2,613; makefile: 1,813; lex: 1,216; xml: 173; awk: 2
file content (38 lines) | stat: -rw-r--r-- 1,020 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*********************************************************************
 *   Copyright 2018, University Corporation for Atmospheric Research
 *   See netcdf/README file for copying and redistribution conditions.
 *   Russ Rew
 *********************************************************************/
#ifndef _ISNAN_H
#define _ISNAN_H

#include "config.h"

#ifndef NO_FLOAT_H
#include <float.h>		/* for DBL_MAX */
#endif /* NO_FLOAT_H */
#include <math.h>

#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
#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 */

#endif /* _ISNAN_H */