mirror of https://github.com/python/cpython.git
Added a missing "|" in the grammar productions used in the reference manual
(reported by François Pinard). Added some missing "_" characters in the same cluster of productions. Added missing floor division operator in m_expr production, and mention floor division in the relevant portion of the text.
This commit is contained in:
parent
67d687a114
commit
af93c4c8d9
|
@ -648,11 +648,12 @@ operators:
|
||||||
\begin{productionlist}
|
\begin{productionlist}
|
||||||
\production{m_expr}
|
\production{m_expr}
|
||||||
{\token{u_expr} | \token{m_expr} "*" \token{u_expr}
|
{\token{u_expr} | \token{m_expr} "*" \token{u_expr}
|
||||||
|
| \token{m_expr} "//" \token{u_expr}
|
||||||
| \token{m_expr} "/" \token{u_expr}}
|
| \token{m_expr} "/" \token{u_expr}}
|
||||||
\productioncont{| \token{m_expr} "\%" \token{u_expr}}
|
\productioncont{| \token{m_expr} "\%" \token{u_expr}}
|
||||||
\production{a_expr}
|
\production{a_expr}
|
||||||
{\token{m_expr} | \token{aexpr} "+" \token{m_expr}
|
{\token{m_expr} | \token{a_expr} "+" \token{m_expr}
|
||||||
\token{aexpr} "-" \token{m_expr}}
|
| \token{a_expr} "-" \token{m_expr}}
|
||||||
\end{productionlist}
|
\end{productionlist}
|
||||||
|
|
||||||
The \code{*} (multiplication) operator yields the product of its
|
The \code{*} (multiplication) operator yields the product of its
|
||||||
|
@ -663,11 +664,12 @@ then multiplied together. In the latter case, sequence repetition is
|
||||||
performed; a negative repetition factor yields an empty sequence.
|
performed; a negative repetition factor yields an empty sequence.
|
||||||
\index{multiplication}
|
\index{multiplication}
|
||||||
|
|
||||||
The \code{/} (division) operator yields the quotient of its
|
The \code{/} (division) and \code{//} (floor division) operators yield
|
||||||
arguments. The numeric arguments are first converted to a common
|
the quotient of their arguments. The numeric arguments are first
|
||||||
type. Plain or long integer division yields an integer of the same
|
converted to a common type. Plain or long integer division yields an
|
||||||
type; the result is that of mathematical division with the `floor'
|
integer of the same type; the result is that of mathematical division
|
||||||
function applied to the result. Division by zero raises the
|
with the `floor' function applied to the result. Division by zero
|
||||||
|
raises the
|
||||||
\exception{ZeroDivisionError} exception.
|
\exception{ZeroDivisionError} exception.
|
||||||
\exindex{ZeroDivisionError}
|
\exindex{ZeroDivisionError}
|
||||||
\index{division}
|
\index{division}
|
||||||
|
|
Loading…
Reference in New Issue