Fix some when building in px4.

This commit is contained in:
James Goppert
2016-08-16 12:37:41 -04:00
parent 4be23552c5
commit 262a715d90
3 changed files with 8 additions and 9 deletions
+5 -6
View File
@@ -478,20 +478,19 @@ bool isEqual(const Matrix<Type, M, N> &x,
return equal;
}
bool isEqual(float x,
float y, float eps);
bool isEqual(float x,
float y, float eps=1e-4f) {
template<typename Type>
bool isEqualF(Type x,
Type y, Type eps=1e-4f) {
bool equal = true;
if (fabs(x - y) > eps) {
if (fabsf(x - y) > eps) {
equal = false;
}
if (!equal) {
printf("not equal\nx:\n%g\ny:\n%g\n", x, y);
printf("not equal\nx:\n%g\ny:\n%g\n", double(x), double(y));
}
return equal;
}