File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,11 +59,11 @@ namespace Platform::Numbers::Bit
5959 {
6060 if (shift < 0 )
6161 {
62- shift = sizeof (T) * 8 + shift;
62+ shift = sizeof (T) * std::numeric_limits< unsigned char >::digits + shift;
6363 }
6464 if (limit < 0 )
6565 {
66- limit = sizeof (T) * 8 + limit;
66+ limit = sizeof (T) * std::numeric_limits< unsigned char >::digits + limit;
6767 }
6868 auto sourceMask = ~(std::numeric_limits<T>::max () << limit) & std::numeric_limits<T>::max ();
6969 auto targetMask = ~(sourceMask << shift);
@@ -75,11 +75,11 @@ namespace Platform::Numbers::Bit
7575 {
7676 if (shift < 0 )
7777 {
78- shift = sizeof (T) * 8 + shift;
78+ shift = sizeof (T) * std::numeric_limits< unsigned char >::digits + shift;
7979 }
8080 if (limit < 0 )
8181 {
82- limit = sizeof (T) * 8 + limit;
82+ limit = sizeof (T) * std::numeric_limits< unsigned char >::digits + limit;
8383 }
8484 auto sourceMask = ~(std::numeric_limits<T>::max () << limit) & std::numeric_limits<T>::max ();
8585 auto targetMask = sourceMask << shift;
You can’t perform that action at this time.
0 commit comments