EKF: Use ecl::powf in comparison test

This commit is contained in:
Paul Riseborough
2020-08-16 08:44:17 +10:00
committed by Paul Riseborough
parent 274523bd98
commit 1ad042da23
2 changed files with 30 additions and 9 deletions
@@ -0,0 +1,24 @@
#include "../../../../../matrix/matrix/math.hpp"
typedef matrix::SquareMatrix<float, 24> SquareMatrix24f;
inline float sq(float in) {
return in * in;
}
namespace ecl{
inline float powf(float x, int exp)
{
float ret;
if (exp > 0) {
ret = x;
for (int count = 1; count < exp; count++) {
ret *= x;
}
return ret;
} else if (exp < 0) {
return 1.0f / ecl::powf(x, -exp);
}
return 1.0f;
}
}