[issue27708] Roudning/Large Int representation error with multiplication and division

2016-08-09 Thread Eric V. Smith
Eric V. Smith added the comment: Thanks for giving an example. You misunderstand how the "/" operator works in python 3.x: the result is always a float. If you use "//", you'll get an integer: >>> 3466242324961998424173065893902035639690591569415662399986947016352506637114522842180319622238911

[issue27708] Roudning/Large Int representation error with multiplication and division

2016-08-09 Thread Ethan Glass
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 3466242324961998424173065893

[issue27708] Roudning/Large Int representation error with multiplication and division

2016-08-09 Thread Eric V. Smith
Eric V. Smith added the comment: Since your result is 6.754791118045615e+200, it's definitely not stored as an integer. If you would show us exactly how you calculated this value, we can explain where the conversion to floating point is taking place. In the meantime, I'm going to close this

[issue27708] Roudning/Large Int representation error with multiplication and division

2016-08-09 Thread Ethan Glass
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, t

[issue27708] Roudning/Large Int representation error with multiplication and division

2016-08-08 Thread Steven D'Aprano
Steven D'Aprano added the comment: > Converting n to an int Oops. Obviously I meant converting n *from* an int *to* a float. -- ___ Python tracker ___ __

[issue27708] Roudning/Large Int representation error with multiplication and division

2016-08-08 Thread Steven D'Aprano
Steven D'Aprano added the comment: Your description is hard to understand, and doesn't give enough detail, but I *think* I can guess what you might be referring to. If you start with a really big integer, and divide, you get a float. But really big floats cannot represent every number exactly

[issue27708] Roudning/Large Int representation error with multiplication and division

2016-08-08 Thread Eric V. Smith
Eric V. Smith added the comment: Actually, Python represents large integers exactly. Can you provide a specific example of a problem you're seeing? -- components: +Interpreter Core -ctypes nosy: +eric.smith ___ Python tracker

[issue27708] Roudning/Large Int representation error with multiplication and division

2016-08-08 Thread Ethan Glass
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: c