On Sat, Feb 08, 2014 at 04:18:09AM -0800, Avichal Dayal wrote:
> Only way I can see to fix this is to try and substitute -1 or 1 for every
> sign(var) instance
> and see if it belongs to [-oo, oo] in every case.
No. We should have a way to examine the image
of the domain where our expression (arg0) is defined.
And take actions accordingly...
For example:
In [69]: r=Symbol('r', real=True, nonzero=True)
In [70]: sign(r).is_real
Out[70]: True
In [71]: sign(r)*oo in [-oo, oo]
Out[71]: False
In [72]: sign(r)*oo in FiniteSet(-oo, oo)
Out[72]: False
In this case - the image is just a finite set, and
it is a subset of the FiniteSet(-oo, oo) (actually, it is
this set). We should be able to take this into account.
> But what if it is -oo/oo sometimes and sometimes not. What output should
> we give then?
Probably, __contains__ method must raise an exception.
Or we should use a different syntax (e.g. Set.subset).
--
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 http://groups.google.com/group/sympy.
For more options, visit https://groups.google.com/groups/opt_out.