mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-22 00:10:35 +08:00
matrix helper: fix sign function zero case
This commit is contained in:
@@ -155,7 +155,7 @@ Type unwrap_pi(const Type last_angle, const Type new_angle)
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
int sign(T val)
|
int sign(T val)
|
||||||
{
|
{
|
||||||
return (T(FLT_EPSILON) < val) - (val < T(FLT_EPSILON));
|
return (T(0) < val) - (val < T(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace matrix
|
} // namespace matrix
|
||||||
|
|||||||
Reference in New Issue
Block a user