diff options
Diffstat (limited to 'src/math')
-rw-r--r-- | src/math/functions.cc | 9 | ||||
-rw-r--r-- | src/math/functions.h | 1 |
2 files changed, 4 insertions, 6 deletions
diff --git a/src/math/functions.cc b/src/math/functions.cc index 53ce41e..e048659 100644 --- a/src/math/functions.cc +++ b/src/math/functions.cc @@ -1,10 +1,9 @@ /* - common/functions.cc + math/functions.cc This file is part of the Osirion project and is distributed under the terms of the GNU General Public License version 2 */ -// project headers #include "math/functions.h" namespace math @@ -43,9 +42,9 @@ unsigned randomi(const unsigned int max) float degrees180f(float angle) { float r = angle; - while (r <= -180.0f) + while (r < -180.0f) r += 360.0f; - while (r >= 180.0f) + while (r > 180.0f) r -= 360.0f; return r; } @@ -55,7 +54,7 @@ float degrees360f(float angle) float r = angle; while (r < 0.0f) r += 360.0f; - while (r >= 360.0f) + while (r > 360.0f) r -= 360.0f; return r; } diff --git a/src/math/functions.h b/src/math/functions.h index d84fe05..3d5d056 100644 --- a/src/math/functions.h +++ b/src/math/functions.h @@ -7,7 +7,6 @@ #ifndef __INCLUDED_MATH_FUNCTIONS_H__ #define __INCLUDED_MATH_FUNCTIONS_H__ -// C++ headers #include <math.h> #include <cstdlib> |