annotate maths/nan-inf.h @ 456:05378924b433
Fix a rounding issue, returning key value 25
The two bins above center B minor are treated as 25. This patch shifts also
the input chromagram by 2 to have center C on 1 like the profiles
author |
Daniel Schürmann <daschuer@mixxx.org> |
date |
Sat, 11 May 2019 02:08:22 +0200 |
parents |
f51af910550f |
children |
701233f8ed41 |
rev |
line source |
c@304
|
1
|
c@304
|
2 #ifndef NAN_INF_H
|
c@304
|
3 #define NAN_INF_H
|
c@304
|
4
|
c@317
|
5 #define ISNAN(x) (sizeof(x) == sizeof(double) ? ISNANd(x) : ISNANf(x))
|
c@317
|
6 static inline int ISNANf(float x) { return x != x; }
|
c@317
|
7 static inline int ISNANd(double x) { return x != x; }
|
c@317
|
8
|
c@317
|
9 #define ISINF(x) (sizeof(x) == sizeof(double) ? ISINFd(x) : ISINFf(x))
|
c@317
|
10 static inline int ISINFf(float x) { return !ISNANf(x) && ISNANf(x - x); }
|
c@317
|
11 static inline int ISINFd(double x) { return !ISNANd(x) && ISNANd(x - x); }
|
c@304
|
12
|
c@304
|
13 #endif
|