Comment #9 on issue 2340 by [email protected]: Float(1) returns Integer
http://code.google.com/p/sympy/issues/detail?id=2340
Author: Fredrik Johansson <[email protected]> 2008-05-25 20:25:27
Committer: Fredrik Johansson <[email protected]> 2008-05-25
20:25:27
Parent: eb414788a6d0cb370a2edd664e405adc8001cc85 (implemented source
command (prints source code of an object))
Child: 19b57a93c4fe8c4a0c1ae9ad0cde793290bdda4e (Add __truediv__() to
Matrix class for real division #867)
Branches: many (1048)
Follows: sympy-0.5.15
Precedes: sympy-0.6.0
Use mpmath instead of the decimal module.
Nearly all uses the decimal module have been replaced by mpmath. In
particular, the Real class uses an mpf to hold its value, and functions
are now evaluated using mpmath.
There is only one change in behavior: Real(2.0) now becomes Real(2.0)
instead of Integer(2). This only broke a single test, and this test
was designed specifically to look for that case. Another test was broken
in spherical harmonics, but a more robust fix in that case was to
sympify
the input (now fixed).
The exception is Real(0.0), which still becomes Integer(0), since the
code that checks for symbolic cancellation seemingly assumes a single
0 instance. There are some more subtle issues involved here, and the
behavior of Real() will have to be revised in the future, but the
present behavior was the easiest solution for now and it doesn't
--
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.