sympy

Chris Angelico rosuav at gmail.com
Thu Mar 31 13:05:01 EDT 2016


On Fri, Apr 1, 2016 at 1:55 AM, Peter Otten <__peter__ at web.de> wrote:
> Hm, the two functions fmsympy() and fm() do not return the same value:
>
> $ python -i sympy_diff.py
> 10000  evaluations with sympy   : dt1 = 0.7178411483764648
> 10000  evaluations without sympy: dt2 = 0.10177111625671387
>>>> fm(42)
> cos(42)
>>>> fmsympy(42)
> -0.399985314988351
>

Maybe not, but that's simply because one of them is completely
evaluated. The cosine of 42 radians is indeed -0.4ish.

>>> math.cos(42)
-0.39998531498835127

ChrisA



More information about the Python-list mailing list