Updates:
        Status: Invalid

Comment #2 on issue 3782 by [email protected]: Error in dividing a symbol by a fraction
http://code.google.com/p/sympy/issues/detail?id=3782

This is due to integer division. SymPy is just built on top of Python, so we have no control of int_literal/int_literal. See http://docs.sympy.org/dev/gotchas.html#python-numbers-vs-sympy-numbers. There are a few things you can do to get around this:

- Use "from __future__ import division". This will at least give you floats always, which should alert you to when this happens, and you won't get strange things like 1/2 == 0.

- Use isympy. This will do the __future__ import division. If you are just working interactively, you can use isympy -i, which will automatically wrap all integer literals with Integer, meaning that you can just type "1/2" instead of Rational(1, 2).

- In code, use S(1)/2, or when you can, avoid int_literal/int_literal by putting something else in between, like 3*x/4 instead of 3/4*x.


--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy-issues?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to