This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Error in example
Type: Stage:
Components: Documentation Versions:
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: accdak, nnorwitz
Priority: normal Keywords:

Created on 2007-06-01 03:08 by accdak, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
PythonDocoError.PNG accdak, 2007-06-01 03:08 Screen shot showing correct response
Messages (2)
msg32172 - (view) Author: accdak (accdak) Date: 2007-06-01 03:08
On http://docs.python.org/tut/node5.html the example:
There is full support for floating point; operators with mixed type operands convert the integer operand to floating point:

>>> 3 * 3.75 / 1.5
7.5

is incorrect.  The resulting value is 5.5 not 7.5
msg32173 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2007-06-01 05:35
Perhaps you misread the star (*) as a plus (+)?

>>> 3 * 3.75 / 1.5
7.5
>>> 3 + 3.75 / 1.5
5.5

For multiplication (*), 7.5 is correct.  For addition (+), 5.5 is correct.
History
Date User Action Args
2022-04-11 14:56:24adminsetgithub: 45021
2007-06-01 03:08:28accdakcreate