Browse Source

AP_Math: compiler warnings: apply is_equal(float)

mission-4.1.18
Tom Pittenger 10 years ago committed by Andrew Tridgell
parent
commit
ac4e7b2b03
  1. 4
      libraries/AP_Math/vector2.cpp
  2. 4
      libraries/AP_Math/vector3.cpp

4
libraries/AP_Math/vector2.cpp

@ -113,13 +113,13 @@ Vector2<T> Vector2<T>::operator -(void) const @@ -113,13 +113,13 @@ Vector2<T> Vector2<T>::operator -(void) const
template <typename T>
bool Vector2<T>::operator ==(const Vector2<T> &v) const
{
return (x==v.x && y==v.y);
return (AP_Math::is_equal(x,v.x) && AP_Math::is_equal(y,v.y));
}
template <typename T>
bool Vector2<T>::operator !=(const Vector2<T> &v) const
{
return (x!=v.x || y!=v.y);
return (!AP_Math::is_equal(x,v.x) || !AP_Math::is_equal(y,v.y));
}
template <typename T>

4
libraries/AP_Math/vector3.cpp

@ -327,13 +327,13 @@ Vector3<T> Vector3<T>::operator -(void) const @@ -327,13 +327,13 @@ Vector3<T> Vector3<T>::operator -(void) const
template <typename T>
bool Vector3<T>::operator ==(const Vector3<T> &v) const
{
return (x==v.x && y==v.y && z==v.z);
return (AP_Math::is_equal(x,v.x) && AP_Math::is_equal(y,v.y) && AP_Math::is_equal(z,v.z));
}
template <typename T>
bool Vector3<T>::operator !=(const Vector3<T> &v) const
{
return (x!=v.x || y!=v.y || z!=v.z);
return (!AP_Math::is_equal(x,v.x) || !AP_Math::is_equal(y,v.y) || !AP_Math::is_equal(z,v.z));
}
template <typename T>

Loading…
Cancel
Save