[libcxx-commits] [libcxx] [libc++][math] Fix undue overflowing of `std::hypot(x, y, z)` (PR #93350)

via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jul 7 06:02:38 PDT 2024


================
@@ -9,11 +9,16 @@
 #ifndef _LIBCPP___MATH_HYPOT_H
 #define _LIBCPP___MATH_HYPOT_H
 
+#include <__algorithm/max.h>
 #include <__config>
+#include <__math/abs.h>
+#include <__math/roots.h>
 #include <__type_traits/enable_if.h>
 #include <__type_traits/is_arithmetic.h>
 #include <__type_traits/is_same.h>
 #include <__type_traits/promote.h>
+#include <array>
----------------
PaulXiCao wrote:

Fixed in cf378ed2d4dd28d8bb5e50ba66c61e30e2195994. I replaced `std::array` usage by `std::pair`.

https://github.com/llvm/llvm-project/pull/93350


More information about the libcxx-commits mailing list