Browse Source

Fix eucmod typos

tags/v0.6.0
Andrew Belt 6 years ago
parent
commit
fec38e8c0d
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      include/util/math.hpp

+ 2
- 2
include/util/math.hpp View File

@@ -37,7 +37,7 @@ inline int absi(int a) {
*/
inline int eucmodi(int a, int base) {
int mod = a % base;
return (mod >= 0) ? mod + base : mod;
return (mod >= 0) ? mod : mod + base;
}

/** Returns floor(log_2(n)), or 0 if n == 1.
@@ -69,7 +69,7 @@ inline float sgnf(float x) {

inline float eucmodf(float a, float base) {
float mod = fmodf(a, base);
return (mod < 0.f) ? mod : mod + base;
return (mod >= 0.f) ? mod : mod + base;
}

inline float nearf(float a, float b, float epsilon = 1e-6) {


Loading…
Cancel
Save