From cc566471e94525c056938b994f94c65c1e53b072 Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Wed, 12 Mar 2014 12:12:20 -0400 Subject: [PATCH] Disambiguate the sqrts we're using --- Base/include/VectorBase.h | 3 ++- Base/test/TestVector.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Base/include/VectorBase.h b/Base/include/VectorBase.h index c9e4ace..945e176 100644 --- a/Base/include/VectorBase.h +++ b/Base/include/VectorBase.h @@ -94,7 +94,8 @@ namespace FasTC { } T LengthSq() const { return this->Dot(*this); } - T Length() const { return static_cast(sqrt(LengthSq())); } + T Length() const { return static_cast( + sqrt(static_cast(LengthSq())));} void Normalize() { T len = Length(); diff --git a/Base/test/TestVector.cpp b/Base/test/TestVector.cpp index 1dcb1b4..b3d2176 100644 --- a/Base/test/TestVector.cpp +++ b/Base/test/TestVector.cpp @@ -179,7 +179,7 @@ TEST(VectorBase, Normalization) { EXPECT_EQ(v2u[0], static_cast(1)); EXPECT_EQ(v2u[1], static_cast(1)); - const double sqrt2 = sqrt(2)/2.0f; + const double sqrt2 = sqrt(2.0f)/2.0f; for(int i = 2; i < 10; i++) { v2f[0] = static_cast(i); v2f[1] = static_cast(i);