mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-03 16:48:52 +08:00
mathlib - Add FLT_EPSILON deadzone in sign computation
This commit is contained in:
committed by
Mathieu Bresciani
parent
410dd85289
commit
59f54a7fd8
@@ -48,7 +48,7 @@ namespace math
|
||||
template<typename T>
|
||||
int sign(T val)
|
||||
{
|
||||
return (T(0) < val) - (val < T(0));
|
||||
return (T(FLT_EPSILON) < val) - (val < T(FLT_EPSILON));
|
||||
}
|
||||
|
||||
// Type-safe signum function with zero treated as positive
|
||||
|
||||
Reference in New Issue
Block a user