[issue43034] Python tutorial misleads users about floor division behavior

2021-07-08 Thread Andrei Kulakov
Andrei Kulakov added the comment: Possibly: 5//2 # 2 -5//2 # -3 Would be easier to understand. -- nosy: +andrei.avk ___ Python tracker ___

[issue43034] Python tutorial misleads users about floor division behavior

2021-01-29 Thread Jesse Silverman
Jesse Silverman added the comment: I understand and agree with both comments. I will confirm that a substantial number of people think -17 // 3 yields -5.0, so when I saw this I wondered if it reinforced that common misconception. I was curious enough to not just confirm in the actual docs

[issue43034] Python tutorial misleads users about floor division behavior

2021-01-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: -17/3 = -5.667 = -6.0 + .333. It is the latter fraction that gets discarded. However, this is a frequent source of confusion. How about adding >>> -17 // 3 -6 >>> -17 % 3 1 >>> -6 * 3 + 1 -17 to illustrate what we mean, without

[issue43034] Python tutorial misleads users about floor division behavior

2021-01-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: The first section of the tutorial isn't the right place to go into these details. The point of the section is to have a basic introduction to the interactive prompt. It is intensionally gentle and lightweight. It isn't the purpose of the tutorial to

[issue43034] Python tutorial misleads users about floor division behavior

2021-01-26 Thread Jesse Silverman
New submission from Jesse Silverman : I had never worked thru the Python tutorial, it's kind of awesome. I noticed multiple independent presenters incorrectly describe the behavior of floor division when the signs of the operands don't match. Not just sloppy ones, some who are usually