Skip to content

Commit c2a177a

Browse files
bpo-39301: State that floor division is used for right shift operations (GH-20347) (GH-20415)
* bpo-39301: State that floor division is used for right shift operations * Remove "without overflow check" (cherry picked from commit af7553a) Co-authored-by: Zackery Spytz <[email protected]>
1 parent 5c1d745 commit c2a177a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Doc/library/stdtypes.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -434,12 +434,10 @@ Notes:
434434
Negative shift counts are illegal and cause a :exc:`ValueError` to be raised.
435435

436436
(2)
437-
A left shift by *n* bits is equivalent to multiplication by ``pow(2, n)``
438-
without overflow check.
437+
A left shift by *n* bits is equivalent to multiplication by ``pow(2, n)``.
439438

440439
(3)
441-
A right shift by *n* bits is equivalent to division by ``pow(2, n)`` without
442-
overflow check.
440+
A right shift by *n* bits is equivalent to floor division by ``pow(2, n)``.
443441

444442
(4)
445443
Performing these calculations with at least one extra sign extension bit in

0 commit comments

Comments
 (0)