[issue36028] Integer Division discrepancy with float

2021-02-07 Thread استاذ بشير كهربائي
Change by استاذ بشير كهربائي : -- nosy: +ba5367125 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36028] Integer Division discrepancy with float

2019-02-19 Thread Au Vo
Au Vo added the comment: thanks for the clarification. You have been a great help. Love Python and our supportive community! -- ___ Python tracker ___

[issue36028] Integer Division discrepancy with float

2019-02-19 Thread Mark Dickinson
Mark Dickinson added the comment: >From a little more digging, it seems that Trinket's Python 2 is based on >Skulpt (so is a JavaScript implementation of a subset of Python), while the >Python 3 "trinket" connects to an Ubuntu Linux server running CPython 3.6.6. --

[issue36028] Integer Division discrepancy with float

2019-02-19 Thread Mark Dickinson
Change by Mark Dickinson : -- resolution: not a bug -> third party ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue36028] Integer Division discrepancy with float

2019-02-19 Thread Mark Dickinson
Mark Dickinson added the comment: > Unfortunately, there's little information about how Trinket is implemented. > Is it CPython-based? >From a little playing around, Trinket only provides a subset of Python (one >might say "batteries not included"), and it's not clear what its basis is.

[issue36028] Integer Division discrepancy with float

2019-02-19 Thread Mark Dickinson
Mark Dickinson added the comment: > Can you double check this, and confirm which Python version and operating > system you're using? Sorry; I missed the screenshots. It looks as though you labelled those the wrong way around, BTW: I think "Screen Shot 2019-02-18 at 9.07.37 PM.png" is the

[issue36028] Integer Division discrepancy with float

2019-02-19 Thread Mark Dickinson
Mark Dickinson added the comment: [Au Vo] > Python2 produces 10.0 as the answers for all of the above calculation. Can you double check this, and confirm which Python version and operating system you're using? Like others, I'm not seeing any difference between Python 2 and Python 3, and as

[issue36028] Integer Division discrepancy with float

2019-02-18 Thread Au Vo
Au Vo added the comment: Here is the Python2 screenshot from trinket.io. There are discrepancies with 1,2,4,8,9, with 9 is given in Python2 and 10 is given in Python3. Again, sorry that Trinket.io does not specify which version of Python3 it implements. -- versions: +Python 2.7

[issue36028] Integer Division discrepancy with float

2019-02-18 Thread Au Vo
Au Vo added the comment: Thanks for the quick turnaround. I have done a little bit more thorough investigation and it does indeed the floating point that causes the behavior. The screenshot attached is done via Python3 from trinket.io. I will submit a screenshot of the Python 2 screenshot

[issue36028] Integer Division discrepancy with float

2019-02-18 Thread Tim Peters
Tim Peters added the comment: Thanks, Steven! I'll go on to suggest that the best intro to these issues for Python programmers is in Python's own tutorial: https://docs.python.org/3/tutorial/floatingpoint.html Raymond, `divmod(a, b)[0]` IS the mathematical `floor(a/b)`, where the latter

[issue36028] Integer Division discrepancy with float

2019-02-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: The open question in my mind is which is the least surprising definition of a//b. Should it be math.floor(a/b) or divmod(a,b)[0]? The advantage of the former is that floor(a/b) is arguably the definition of floor division. The advantage of the latter is

[issue36028] Integer Division discrepancy with float

2019-02-18 Thread Steven D'Aprano
Steven D'Aprano added the comment: Changing the title from referring to "decimal" to "float", since this has nothing to do with the decimal module or Decimal type. Like Raymond and Tim, I too cannot reproduce the claimed difference in behaviour between Python 2.7 and 3.x. Au Vo, there are