[libcxx-commits] [libcxx] 6e8659c - [libc++] Fix typo in std::midpoint
Fangrui Song via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Dec 21 01:26:37 PST 2019
Author: Ruslan Baratov
Date: 2019-12-21T01:26:24-08:00
New Revision: 6e8659c351fe3a38ed23f5a5b24c1bc143ea00ed
URL: https://github.com/llvm/llvm-project/commit/6e8659c351fe3a38ed23f5a5b24c1bc143ea00ed
DIFF: https://github.com/llvm/llvm-project/commit/6e8659c351fe3a38ed23f5a5b24c1bc143ea00ed.diff
LOG: [libc++] Fix typo in std::midpoint
Reviewed By: mclow.lists
Differential Revision: https://reviews.llvm.org/D71525
Added:
Modified:
libcxx/include/numeric
Removed:
################################################################################
diff --git a/libcxx/include/numeric b/libcxx/include/numeric
index 11a5641bb3b0..5ceadc17755e 100644
--- a/libcxx/include/numeric
+++ b/libcxx/include/numeric
@@ -573,7 +573,7 @@ midpoint(_Fp __a, _Fp __b) noexcept
return __fp_abs(__a) <= __hi && __fp_abs(__b) <= __hi ? // typical case: overflow is impossible
(__a + __b)/2 : // always correctly rounded
__fp_abs(__a) < __lo ? __a + __b/2 : // not safe to halve a
- __fp_abs(__a) < __lo ? __a/2 + __b : // not safe to halve b
+ __fp_abs(__b) < __lo ? __a/2 + __b : // not safe to halve b
__a/2 + __b/2; // otherwise correctly rounded
}
More information about the libcxx-commits
mailing list