mirror of https://github.com/ArduPilot/ardupilot
Math: maxf and minf functions
This commit is contained in:
parent
629a5fd714
commit
46c652e42f
|
@ -117,3 +117,12 @@ float pythagorous2(float a, float b) {
|
|||
float pythagorous3(float a, float b, float c) {
|
||||
return sqrtf(sq(a)+sq(b)+sq(c));
|
||||
}
|
||||
|
||||
float maxf(float a, float b)
|
||||
{
|
||||
return (a>b?a:b);
|
||||
}
|
||||
float minf(float a, float b)
|
||||
{
|
||||
return (a<b?a:b);
|
||||
}
|
||||
|
|
|
@ -193,6 +193,8 @@ float pythagorous3(float a, float b, float c);
|
|||
#define max(a,b) ((a)>(b)?(a):(b))
|
||||
#define min(a,b) ((a)<(b)?(a):(b))
|
||||
|
||||
float maxf(float a, float b);
|
||||
float minf(float a, float b);
|
||||
|
||||
#endif // AP_MATH_H
|
||||
|
||||
|
|
Loading…
Reference in New Issue