[issue27708] Roudning/Large Int representation error with multiplication and division
New submission from Ethan Glass: Python represents large integers as floating-points, which may or may not be the cause or part of the cause of division of said large integers evaluating to a floating-point number usually within a 1-integer range of the correct result. -- components: ctypes messages: 272160 nosy: eglass priority: normal severity: normal status: open title: Roudning/Large Int representation error with multiplication and division type: behavior versions: Python 3.6 ___ Python tracker <http://bugs.python.org/issue27708> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27708] Roudning/Large Int representation error with multiplication and division
Ethan Glass added the comment: I actually started with a very small integer, said integer being 14. I then multiplied it by two large integers(10^100 or higher).I no longer have access to the two large integers, as they were never stored. When I divided the product by the two large integers, the quotient is returned as 13, 14, or 15. I have done more testing and found that the correct quotient of 14 is almost always returned, but 13 or 15 are returned occasionally. I am not trying to convert anything to/from a float to/from an integer. I typed a similar equation into the python shell and found that if I only divide by one of the factors, the return is a floating point that appears something like this: 6.754791118045615e+200 This is displayed in scientific notation as a float multiplied by 10^200. I do not know if this is how the computer processes and stored the integer or just how it is displayed,but if it is in fact how the integer is stored, it would theoretically be subject to rounding errors. -- ___ Python tracker <http://bugs.python.org/issue27708> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27708] Roudning/Large Int representation error with multiplication and division
Ethan Glass added the comment: As I said in a previous post, the numbers used are not stored. I ran the algorithm again in the shell with the following result. >>>4332802906202498030216332367377544549613239461769577836837704406332963931535527253995277986388432*8 346624232496199842417306589390203563969059156941566239998694701635250663711452284218031962223891107456 >>>346624232496199842417306589390203563969059156941566239998694701635250663711452284218031962223891107456/8 4.332802906202498e+100 -- status: closed -> open ___ Python tracker <http://bugs.python.org/issue27708> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27708] Rounding/Large Int representation error with multiplication and division
Ethan Glass added the comment: Thank you so much! -- ___ Python tracker <http://bugs.python.org/issue27708> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com