diff --git a/libstdc++-v3/include/experimental/numeric b/libstdc++-v3/include/experimental/numeric index a11516b..b284110 100644 --- a/libstdc++-v3/include/experimental/numeric +++ b/libstdc++-v3/include/experimental/numeric @@ -40,7 +40,6 @@ #else #include -#include namespace std _GLIBCXX_VISIBILITY(default) { @@ -52,7 +51,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #define __cpp_lib_experimental_gcd_lcm 201411 - // Greatest common divisor + /// Greatest common divisor template constexpr common_type_t<_Mn, _Nn> gcd(_Mn __m, _Nn __n) @@ -60,12 +59,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION static_assert(is_integral<_Mn>::value, "arguments to gcd are integers"); static_assert(is_integral<_Nn>::value, "arguments to gcd are integers"); - return __m == 0 ? std::abs(__n) - : __n == 0 ? std::abs(__m) - : fundamentals_v2::gcd(__n, __m % __n); + return __m == 0 ? __builtin_abs(__n) + : __n == 0 ? __builtin_abs(__m) + : gcd(__n, __m % __n); } - // Least common multiple + /// Least common multiple template constexpr common_type_t<_Mn, _Nn> lcm(_Mn __m, _Nn __n) @@ -74,7 +73,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION static_assert(is_integral<_Nn>::value, "arguments to lcm are integers"); return (__m != 0 && __n != 0) - ? (std::abs(__m) / fundamentals_v2::gcd(__m, __n)) * std::abs(__n) + ? (__builtin_abs(__m) / gcd(__m, __n)) * __builtin_abs(__n) : 0; }