Open bgatessucks opened 6 years ago
@bgatessucks I think I was a bit stingy with parens when implementing. I'll just put everything in parens and then later come back and potentially apply some post-processing to get rid of unnecessary ones. I'll give that a patch. For the second issue, the behavior I have in is correct for python3, which is my default python. It also better agrees with the Mathematica code. 1/2.
should be use for the approximate value and 1/2
for the exact one, which has a different interpretation in python2 and python3
Thanks.
I got past that by using a wrapper for expressions like Times
and Power
, then I undid it on the python side.
I think there are missing parenthesis in the conversion of Mathematica expressions to Python, and this alters the result due to the precedence of algebraic operations. Examples using Mathematica 11.3 and PyTool 1.0.9s:
Notice that the output of
ToSymbolicPython[...] // ToPython
contains expressions such as1/2
which would return0
when evaluated in Python.