Browse Source

AP_Math: fixed vector inequality test

many thanks to cat888

fixes issue #2039
mission-4.1.18
Andrew Tridgell 10 years ago
parent
commit
728dbf24db
  1. 2
      libraries/AP_Math/vector2.cpp
  2. 2
      libraries/AP_Math/vector3.cpp

2
libraries/AP_Math/vector2.cpp

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

2
libraries/AP_Math/vector3.cpp

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

Loading…
Cancel
Save