Hi,

On Fri, May 21, 2010 at 05:02:40PM -0600, Aaron S. Meurer wrote:
> What is supposed to be the meaning of "quo" and "exquo" in the Polys?  
> Looking in densearith.py, I see things like this:
> 
> def dup_quo(f, g, K):
>     """Returns polynomial quotient in `K[x]`. """
>     q, r = dup_div(f, g, K)
> 
>     if not r:
>         return q
>     else:
>         raise ExactQuotientFailed('%s does not divide %s' % (g, f))
> 
> def dup_exquo(f, g, K):
>     """Returns exact polynomial quotient in `K[x]`. """
>     return dup_div(f, g, K)[0]
> 
> But I would have expected the exact opposite: for quo to give be the quotient 
> without caring and for exquo to warn me when the quotient is not exact.  So 
> what is the reasoning behind the current behavior?
> 

it depends on the point of view. My interpretation is like this: exquo() means
that the we know in advance that the quotient will be exact (no remainder) and
we don't want to lose time for checking the remainder. In your interpretation,
exquo() asks if the quotient is exact and returns it, if remainder vanishes.
This is what Axiom does (actually I thought before it does the job my way).

Anyway, I don't like the name exquo at all, as interpretations may vary. It
would be better to have quo() for what currently exquo() function does, and
e.g. quo_if_can(), for the other version.

I think we should at least switch the meaning of quo() and exquo(), and think
if the name exquo is the right one.

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

-- 
Mateusz

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to