From ac4e7b2b03b10160050ae050b6cfeaf3ba08abaf Mon Sep 17 00:00:00 2001 From: Tom Pittenger Date: Fri, 1 May 2015 23:49:51 -0700 Subject: [PATCH] AP_Math: compiler warnings: apply is_equal(float) --- libraries/AP_Math/vector2.cpp | 4 ++-- libraries/AP_Math/vector3.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/AP_Math/vector2.cpp b/libraries/AP_Math/vector2.cpp index d8dd97bc88..99f1f364e1 100644 --- a/libraries/AP_Math/vector2.cpp +++ b/libraries/AP_Math/vector2.cpp @@ -113,13 +113,13 @@ Vector2 Vector2::operator -(void) const template bool Vector2::operator ==(const Vector2 &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 bool Vector2::operator !=(const Vector2 &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 diff --git a/libraries/AP_Math/vector3.cpp b/libraries/AP_Math/vector3.cpp index 8dfeff7f17..740467adc8 100644 --- a/libraries/AP_Math/vector3.cpp +++ b/libraries/AP_Math/vector3.cpp @@ -327,13 +327,13 @@ Vector3 Vector3::operator -(void) const template bool Vector3::operator ==(const Vector3 &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 bool Vector3::operator !=(const Vector3 &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