diff options
Diffstat (limited to 'src/math')
-rw-r--r-- | src/math/functions.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/math/functions.h b/src/math/functions.h index 16de778..d84fe05 100644 --- a/src/math/functions.h +++ b/src/math/functions.h @@ -58,7 +58,10 @@ inline void clamp(float &value, float min=0.0f, float max=1.0f) /// return the absolute value of a float inline float absf(float f) { - if (f >0) return f; else return -f; + if (f < 0) + return -f; + else + return f; } } // namespace math |