mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-17 06:57:34 +08:00
mathlib delete floorf in favor of math.h
This commit is contained in:
committed by
Paul Riseborough
parent
340d85afc1
commit
cd34ab802d
@@ -46,10 +46,10 @@
|
|||||||
|
|
||||||
#include <mathlib/mathlib.h>
|
#include <mathlib/mathlib.h>
|
||||||
|
|
||||||
|
#include <math.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
using math::constrain;
|
using math::constrain;
|
||||||
using math::floorf;
|
|
||||||
|
|
||||||
/** set this always to the sampling in degrees for the table below */
|
/** set this always to the sampling in degrees for the table below */
|
||||||
static constexpr float SAMPLING_RES = 10.0f;
|
static constexpr float SAMPLING_RES = 10.0f;
|
||||||
|
|||||||
@@ -70,16 +70,6 @@ float degrees(float radians)
|
|||||||
return (radians * 180.0f) / M_PI_F;
|
return (radians * 180.0f) / M_PI_F;
|
||||||
}
|
}
|
||||||
|
|
||||||
int floorf(float input)
|
|
||||||
{
|
|
||||||
int res = int(input);
|
|
||||||
if (res > input) {
|
|
||||||
res--;
|
|
||||||
}
|
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace math
|
} // namespace math
|
||||||
|
|
||||||
#endif /* ECL_STANDALONE */
|
#endif /* ECL_STANDALONE */
|
||||||
|
|||||||
@@ -60,7 +60,6 @@ float max(float val1, float val2);
|
|||||||
float constrain(float val, float min, float max);
|
float constrain(float val, float min, float max);
|
||||||
float radians(float degrees);
|
float radians(float degrees);
|
||||||
float degrees(float radians);
|
float degrees(float radians);
|
||||||
int floorf(float input);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|||||||
Reference in New Issue
Block a user