Status: Accepted
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 3010 by [email protected]: addiing float to long Integer should
not lose precision in Integer
http://code.google.com/p/sympy/issues/detail?id=3010
Integer(S(12345678901234567890)+.5)
12345678901234567168
Integer(S(12345678901234567890)+Float(.5,15))
12345678901234567168
Integer(S(12345678901234567890)+Float(.5,17))
12345678901234567888
Integer(S(12345678901234567890)+Float(.5,18))
12345678901234567890
Since all the digits of Integer are known and the .5 is known to a
precision of 15 digits, I wouldn't think Integer should lose precision. I
would expect that the new number would be
12345678901234567890.500000000000000. And if the .5 were given with even a
precision of 2 I would expect deviations in the 3rd decimal place but
instead, most of the significance in the Integer is lost:
Integer(S(12345678901234567890)+Float(.5,2))
12339862978995159040
see issue 1073, too
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en.