mirror of
https://github.com/yuzu-emu/FasTC.git
synced 2025-01-09 02:35:41 +00:00
Disambiguate the sqrts we're using
This commit is contained in:
parent
6fdc3814b1
commit
cc566471e9
|
@ -94,7 +94,8 @@ namespace FasTC {
|
||||||
}
|
}
|
||||||
|
|
||||||
T LengthSq() const { return this->Dot(*this); }
|
T LengthSq() const { return this->Dot(*this); }
|
||||||
T Length() const { return static_cast<T>(sqrt(LengthSq())); }
|
T Length() const { return static_cast<T>(
|
||||||
|
sqrt(static_cast<long double>(LengthSq())));}
|
||||||
|
|
||||||
void Normalize() {
|
void Normalize() {
|
||||||
T len = Length();
|
T len = Length();
|
||||||
|
|
|
@ -179,7 +179,7 @@ TEST(VectorBase, Normalization) {
|
||||||
EXPECT_EQ(v2u[0], static_cast<unsigned>(1));
|
EXPECT_EQ(v2u[0], static_cast<unsigned>(1));
|
||||||
EXPECT_EQ(v2u[1], static_cast<unsigned>(1));
|
EXPECT_EQ(v2u[1], static_cast<unsigned>(1));
|
||||||
|
|
||||||
const double sqrt2 = sqrt(2)/2.0f;
|
const double sqrt2 = sqrt(2.0f)/2.0f;
|
||||||
for(int i = 2; i < 10; i++) {
|
for(int i = 2; i < 10; i++) {
|
||||||
v2f[0] = static_cast<float>(i);
|
v2f[0] = static_cast<float>(i);
|
||||||
v2f[1] = static_cast<float>(i);
|
v2f[1] = static_cast<float>(i);
|
||||||
|
|
Loading…
Reference in a new issue