HephAudio v3.0.6
A cross-platform C++ library for recording, playing, and processing audio on Windows, Android, Linux, iOS, and macOS.
Loading...
Searching...
No Matches
HephMath.h File Reference
#include "HephShared.h"
#include <cmath>
#include <cinttypes>
#include <float.h>

Go to the source code of this file.

Macros

#define HEPH_MATH_PI   (3.14159265358979323846)
 
#define HEPH_MATH_E   (2.71828182845904523536)
 
#define HEPH_MATH_SGN(x)   ((x) > 0 ? 1 : ((x) < 0 ? -1 : 0))
 
#define HEPH_MATH_MIN(a, b)   ((a) > (b) ? (b) : (a))
 
#define HEPH_MATH_MAX(a, b)   ((a) > (b) ? (a) : (b))
 
#define HEPH_MATH_RAD_TO_DEG(x)   ((x) * (180.0 / HEPH_MATH_PI))
 
#define HEPH_MATH_DEG_TO_RAD(x)   ((x) * (HEPH_MATH_PI / 180.0))
 

Macro Definition Documentation

◆ HEPH_MATH_SGN

#define HEPH_MATH_SGN ( x)    ((x) > 0 ? 1 : ((x) < 0 ? -1 : 0))

gets the sign of x.

◆ HEPH_MATH_MIN

#define HEPH_MATH_MIN ( a,
b )   ((a) > (b) ? (b) : (a))

gets the minimum of a and b.

◆ HEPH_MATH_MAX

#define HEPH_MATH_MAX ( a,
b )   ((a) > (b) ? (a) : (b))

gets the maximum of a and b.

◆ HEPH_MATH_RAD_TO_DEG

#define HEPH_MATH_RAD_TO_DEG ( x)    ((x) * (180.0 / HEPH_MATH_PI))

converts x to degree.

◆ HEPH_MATH_DEG_TO_RAD

#define HEPH_MATH_DEG_TO_RAD ( x)    ((x) * (HEPH_MATH_PI / 180.0))

converts x to radian.