diff --git a/src/SFML/System/Vector2.cpp b/src/SFML/System/Vector2.cpp index 9c8b389d..cd2272a2 100644 --- a/src/SFML/System/Vector2.cpp +++ b/src/SFML/System/Vector2.cpp @@ -106,8 +106,8 @@ template T Vector2::length() const { static_assert(std::is_floating_point_v, "Vector2::length() is only supported for floating point types"); - - return std::hypot(x, y); + + return std::sqrt(x*x + y*y); } } // namespace sf diff --git a/src/SFML/System/Vector3.cpp b/src/SFML/System/Vector3.cpp index fa52b9fc..89cb5106 100644 --- a/src/SFML/System/Vector3.cpp +++ b/src/SFML/System/Vector3.cpp @@ -48,7 +48,7 @@ T Vector3::length() const { static_assert(std::is_floating_point_v, "Vector3::length() is only supported for floating point types"); - return std::hypot(x, y, z); + return std::sqrt(x*x + y*y + z*z); } } // namespace sf