view 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
line wrap: on
line source

#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