|
template<typename T > |
bool | isEven (T x) |
| Returns true if x is odd. More...
|
|
template<typename T > |
bool | isOdd (T x) |
| Returns true if x is odd. More...
|
|
int | clamp (int x, int a, int b) |
| Limits x between a and b . More...
|
|
int | clampSafe (int x, int a, int b) |
| Limits x between a and b . More...
|
|
int | eucMod (int a, int b) |
| Euclidean modulus. More...
|
|
int | eucDiv (int a, int b) |
| Euclidean division. More...
|
|
void | eucDivMod (int a, int b, int *div, int *mod) |
|
int | log2 (int n) |
| Returns floor(log_2(n)) , or 0 if n == 1 . More...
|
|
template<typename T > |
bool | isPow2 (T n) |
| Returns whether n is a power of 2. More...
|
|
template<typename T > |
T | sgn (T x) |
| Returns 1 for positive numbers, -1 for negative numbers, and 0 for zero. More...
|
|
float | clamp (float x, float a, float b) |
| Limits x between a and b . More...
|
|
float | clampSafe (float x, float a, float b) |
| Limits x between a and b . More...
|
|
float | normalizeZero (float x) |
| Converts -0.f to 0.f. More...
|
|
float | eucMod (float a, float b) |
| Euclidean modulus. More...
|
|
bool | isNear (float a, float b, float epsilon=1e-6f) |
| Returns whether a is within epsilon distance from b . More...
|
|
float | chop (float x, float epsilon=1e-6f) |
| If the magnitude of x if less than epsilon, return 0. More...
|
|
float | rescale (float x, float xMin, float xMax, float yMin, float yMax) |
|
float | crossfade (float a, float b, float p) |
|
float | interpolateLinear (const float *p, float x) |
| Linearly interpolates an array p with index x . More...
|
|
void | complexMult (float ar, float ai, float br, float bi, float *cr, float *ci) |
| Complex multiplication c = a * b . More...
|
|
Supplemental <cmath>
functions and types.
void rack::math::complexMult |
( |
float |
ar, |
|
|
float |
ai, |
|
|
float |
br, |
|
|
float |
bi, |
|
|
float * |
cr, |
|
|
float * |
ci |
|
) |
| |
|
inline |
Complex multiplication c = a * b
.
Arguments may be the same pointers. Example:
cmultf(ar, ai, br, bi, &ar, &ai);