On Sunday, February 15, 2015 at 3:55:28 PM UTC+3, Arnaud Usciati wrote:
>
> If x = symbols('x', real=True).
>
> I found wrong results for limits with sign() function.
> limit(sign(x), x, 0, '+') = 1, and limit(sign(x), x, 0, '-') = -1 ---> OK
>
> But :
> - limit(sign(ln(x)), x, 1, '+') = 1 (OK) but limit(sign(ln(x)), x, 1, '-') 
> = 0 instead of -1 ;
> - limit(sign(sin(x)), x, 0, '+') = 0 and limit(sign(sin(x)), x, 0, '-') = 
> 0, instead of 1 and -1 ;
> - limit(sign(tan(x)), x, 0, '+') = 0 and limit(sign(tan(x)), x, 0, '-') = 
> 0, instead of 1 and -1 ;
> - limit(sign(cos(x)), x, pi/2, '+') = 0 and limit(sign(cos(x)), x, pi/2, 
> '-') = 0, instead of 1 and -1 ;
> Etc......
>

Patch: https://github.com/skirpichev/omg/pull/154
(Should work for sympy with trivial replacement .is_extended_real -> 
.is_real)

Please note that
> limit(sign(cos(x)), x, pi/2, '+') = 0 and limit(sign(cos(x)), x, pi/2, 
'-') = 0, instead of 1 and -1 ;

is incorrect.  Should be -1 and 1 instead, c.f. Mathematica output:

In[3]:= Limit[Sign[Cos[x]], x->Pi/2, Direction->-1] (* default, equivalent 
to dir="+" *)
Out[3]= 
-1
In[4]:= Limit[Sign[Cos[x]], x->Pi/2, Direction->+1]
Out[4]= 
1

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" 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 https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/7be3c90d-fd7d-46f3-abed-1e8c40a25aa7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to