Comment #1 on issue 3052 by [email protected]: evaluating Abs should result in a positive number
http://code.google.com/p/sympy/issues/detail?id=3052

I'm not sure if this is fixable. Once you substitute in a number, abs evaluates it:

In [30]: print e.subs(x,Rational('.1'))
-3.14159265358979e+20*cos(1/10)**2 - 3.14159265358979e+20*sin(1/10)**2 + 3.14159265358979e+20

So by the time you call .n(), the abs is gone. Since the number is really zero, it's going to give you something really close to zero, but with the abs gone, it could appear on either side.

Actually, I think the default precision results in a negative number:

In [32]: e.args[0].subs(x,Rational('.1')).n()
Out[32]: -.0e-118

so Abs() evaluates it to its negative.


--
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.

Reply via email to