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
Go to the documentation of this file.
1#pragma once
2#include "HephShared.h"
3#include <cmath>
4#include <cinttypes>
5#include <float.h>
6
30#define HEPH_MATH_PI (3.14159265358979323846)
31#define HEPH_MATH_E (2.71828182845904523536)
32
33#define HEPH_MATH_SGN(x) ((x) > 0 ? 1 : ((x) < 0 ? -1 : 0))
34
35#define HEPH_MATH_MIN(a, b) ((a) > (b) ? (b) : (a))
36#define HEPH_MATH_MAX(a, b) ((a) > (b) ? (a) : (b))
37
38#define HEPH_MATH_RAD_TO_DEG(x) ((x) * (180.0 / HEPH_MATH_PI))
39#define HEPH_MATH_DEG_TO_RAD(x) ((x) * (HEPH_MATH_PI / 180.0))