mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-05 07:41:36 +08:00
matrix helper: add documentation for sign function
This commit is contained in:
@@ -152,6 +152,12 @@ Type unwrap_pi(const Type last_angle, const Type new_angle)
|
|||||||
return unwrap(last_angle, new_angle, Type(-M_PI), Type(M_PI));
|
return unwrap(last_angle, new_angle, Type(-M_PI), Type(M_PI));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Type-safe sign/signum function
|
||||||
|
*
|
||||||
|
* @param[in] val Number to take the sign from
|
||||||
|
* @return -1 if val < 0, 0 if val == 0, 1 if val > 0
|
||||||
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
int sign(T val)
|
int sign(T val)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user