diff --git a/src/util/numeric.h b/src/util/numeric.h index 4863f805b..d67dd0f5f 100644 --- a/src/util/numeric.h +++ b/src/util/numeric.h @@ -27,6 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "irr_aabb3d.h" #include "SColor.h" #include +#include #define rangelim(d, min, max) ((d) < (min) ? (min) : ((d) > (max) ? (max) : (d))) #define myfloor(x) ((x) < 0.0 ? (int)(x) - 1 : (int)(x)) @@ -195,30 +196,10 @@ struct MeshGrid { * * \note This is also used in cases where degrees wrapped to the range [0, 360] * is innapropriate (e.g. pitch needs negative values) - * - * \internal functionally equivalent -- although precision may vary slightly -- - * to fmodf((f), 360.0f) however empirical tests indicate that this approach is - * faster. */ inline float modulo360f(float f) { - int sign; - int whole; - float fraction; - - if (f < 0) { - f = -f; - sign = -1; - } else { - sign = 1; - } - - whole = f; - - fraction = f - whole; - whole %= 360; - - return sign * (whole + fraction); + return fmodf(f, 360.0f); }