Skip to content

Commit 0aaae26

Browse files
committed
Clarify two points about division and shifting. Suggested by Albert Hofkamp on docs@.
1 parent f24c141 commit 0aaae26

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Doc/reference/expressions.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,7 @@ repetition is performed; a negative repetition factor yields an empty sequence.
912912

913913
The ``/`` (division) and ``//`` (floor division) operators yield the quotient of
914914
their arguments. The numeric arguments are first converted to a common type.
915-
Integer division yields a float, while floor division of integers results in an
915+
Division of integers yields a float, while floor division of integers results in an
916916
integer; the result is that of mathematical division with the 'floor' function
917917
applied to the result. Division by zero raises the :exc:`ZeroDivisionError`
918918
exception.
@@ -972,8 +972,8 @@ the left or right by the number of bits given by the second argument.
972972

973973
.. index:: exception: ValueError
974974

975-
A right shift by *n* bits is defined as division by ``pow(2,n)``. A left shift
976-
by *n* bits is defined as multiplication with ``pow(2,n)``.
975+
A right shift by *n* bits is defined as floor division by ``pow(2,n)``. A left
976+
shift by *n* bits is defined as multiplication with ``pow(2,n)``.
977977

978978
.. note::
979979

0 commit comments

Comments
 (0)