mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-28 01:30:36 +08:00
fixed calculation of magentic table values by using floor instead of int casting
This commit is contained in:
committed by
Lorenz Meier
parent
54ac147ae8
commit
710c52980e
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user