File: nan-inf.h

package info (click to toggle)
qm-dsp 1.7.1-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 4,932 kB
  • ctags: 1,644
  • sloc: cpp: 59,844; ansic: 8,603; python: 508; makefile: 242; sh: 5
file content (13 lines) | stat: -rw-r--r-- 455 bytes parent folder | download | duplicates (16)
1
2
3
4
5
6
7
8
9
10
11
12
13

#ifndef NAN_INF_H
#define NAN_INF_H

#define ISNAN(x) (sizeof(x) == sizeof(double) ? ISNANd(x) : ISNANf(x))
static inline int ISNANf(float x) { return x != x; }
static inline int ISNANd(double x) { return x != x; }
          
#define ISINF(x) (sizeof(x) == sizeof(double) ? ISINFd(x) : ISINFf(x))
static inline int ISINFf(float x) { return !ISNANf(x) && ISNANf(x - x); }
static inline int ISINFd(double x) { return !ISNANd(x) && ISNANd(x - x); }

#endif