On Fri, Sep 16, 2011 at 3:19 AM, Hector <[email protected]> wrote:
> > > On Fri, Sep 16, 2011 at 2:40 AM, Chris Smith <[email protected]> wrote: > >> instead of `a%p` write `a % p`. Also, since this will have to be >> computed again later you might as well do both at the same time: >> >> a, r = divmod(a, p) > > if not r: >> return 0 >> if is_quad_residue(a, p): >> return 1 >> else: >> return -1 >> > > for a, p = 5, 11; divmod(a, p) returns (0, 5) and we will be losing the > value of a if a < p and hence with little modification - > A little more modification - _, a = divmod(a, p) if not a : return 0 if is_quad_residue(a, p): return 1 else: return -1 > >> -- >> 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. >> >> > > > -- > -Regards > Hector > > Whenever you think you can or you can't, in either way you are right. > > -- -Regards Hector Whenever you think you can or you can't, in either way you are right. -- 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.
