aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/std/bit
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3/include/std/bit')
-rw-r--r--libstdc++-v3/include/std/bit4
1 files changed, 2 insertions, 2 deletions
diff --git a/libstdc++-v3/include/std/bit b/libstdc++-v3/include/std/bit
index ace8895..a23f2ba 100644
--- a/libstdc++-v3/include/std/bit
+++ b/libstdc++-v3/include/std/bit
@@ -46,7 +46,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
constexpr auto _Nd = numeric_limits<_Tp>::digits;
const unsigned __sN = __s % _Nd;
- return (__x << __sN) | (__x >> ((-__sN) % _Nd));
+ return (__x << __sN) | (__x >> ((_Nd - __sN) % _Nd));
}
template<typename _Tp>
@@ -55,7 +55,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
constexpr auto _Nd = numeric_limits<_Tp>::digits;
const unsigned __sN = __s % _Nd;
- return (__x >> __sN) | (__x << ((-__sN) % _Nd));
+ return (__x >> __sN) | (__x << ((_Nd - __sN) % _Nd));
}
template<typename _Tp>