fixed calculation of magentic table values by using floor instead of int casting

This commit is contained in:
Sebastian Verling
2019-05-23 14:17:40 +02:00
committed by Lorenz Meier
parent 54ac147ae8
commit 710c52980e
3 changed files with 14 additions and 2 deletions
+10
View File
@@ -70,6 +70,16 @@ float degrees(float radians)
return (radians * 180.0f) / M_PI_F;
}
int floorf(float input)
{
int res = int(input);
if (res > input) {
res--;
}
return res;
}
} // namespace math
#endif /* ECL_STANDALONE */
+1
View File
@@ -60,6 +60,7 @@ float max(float val1, float val2);
float constrain(float val, float min, float max);
float radians(float degrees);
float degrees(float radians);
int floorf(float input);
}
#else