Browse Source

Remove abs() function in rack namespace, remove cmath include

tags/v0.6.0
Andrew Belt 7 years ago
parent
commit
ddf97fa161
2 changed files with 0 additions and 12 deletions
  1. +0
    -1
      include/util/common.hpp
  2. +0
    -11
      include/util/math.hpp

+ 0
- 1
include/util/common.hpp View File

@@ -8,7 +8,6 @@
#include <string.h> #include <string.h>
#include <assert.h> #include <assert.h>


#include <cmath>
#include <string> #include <string>
#include <condition_variable> #include <condition_variable>
#include <mutex> #include <mutex>


+ 0
- 11
include/util/math.hpp View File

@@ -23,13 +23,6 @@ inline int clamp(int x, int minimum, int maximum) {
return min(max(x, minimum), maximum); return min(max(x, minimum), maximum);
} }


/** Absolute value of a
Undefined for a == INT_MIN
*/
inline int abs(int a) {
return (a >= 0) ? a : -a;
}

/** Euclidean modulus, always returns 0 <= mod < base for positive base. /** Euclidean modulus, always returns 0 <= mod < base for positive base.
*/ */
inline int eucmod(int a, int base) { inline int eucmod(int a, int base) {
@@ -55,10 +48,6 @@ inline bool ispow2(int n) {
// basic float functions (suffixed with "f") // basic float functions (suffixed with "f")
//////////////////// ////////////////////


inline float abs(float x) {
return (x >= 0.0f) ? x : -x;
}

/** Returns 1.f for positive numbers and -1.f for negative numbers (including positive/negative zero) */ /** Returns 1.f for positive numbers and -1.f for negative numbers (including positive/negative zero) */
inline float sgn(float x) { inline float sgn(float x) {
return copysignf(1.0f, x); return copysignf(1.0f, x);


Loading…
Cancel
Save