Hi.

This question is mainly for Mateusz, but I encourage others to chime
in too if they have an opinion.

I need the following behavior in the polys:

>>> Poly(0, t).cancel(Poly(t, t), include=True)
(Poly(0, t), Poly(1, t))

Whereas it currently does the following:

>>> Poly(0, t).cancel(Poly(t, t), include=True)
(Poly(0, t), Poly(t, t))

(notice that the denominator is reduced to 1 in the first case and
left alone in the second).  I need the former to make it easier to
deal with zero rational functions in my Risch code.

Now, this is one of four possibilities in cancel.  They are:

1. Poly(0, t).cancel(Poly(t, t), include=True) # 0/q include=True;
this is the one I use
2. Poly(0, t).cancel(Poly(t, t), include=False) # 0/q include=False
3. Poly(t, t).cancel(Poly(0, t), include=True) # p/0 include=True
4. Poly(t, t).cancel(Poly(0, t), include=False) # p/0 include=False

I did not change 2-4 in my branch yet because I only ever use the
first idiom in my code, but I think we should try to make it
consistant.  So my questions are:

- Should 2 return a one denominator too?  I don't actually care if it
does, but it seems like it should to be consistant with 1.
- What should the returned coefficient from 2 be?  I never actually
use include=False, so I don't really have a feel for this.
- Should 3 and 4 even work?  To me they should raise an exception, but
maybe it isn't necessary to think of f.cancel(g) as f/g (though that
is what the docstring says).

Aaron Meurer

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" 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?hl=en.

Reply via email to