Bug in Polynomial_zmod_flint, the remainder is returned instead of the 
quotient:

sage: F = GF(47) 
sage: x = polygen(F) 
sage: u = F(1) 
sage: x.quo_rem(u)
(x, 0)
sage: x // u    # should be quo
0
sage: x % u     # is rem
0




On Thursday, August 7, 2014 4:39:18 PM UTC+1, John Cremona wrote:
>
> Can someone explain this? 
>
> sage: F = GF(47) 
> sage: x = polygen(F) 
> sage: u = F(1) 
> sage: x/u 
> x 
> sage: x//u 
> 0 
>
> I would expect the second result to be the same as the first, as an 
> exact division.  And over (for example) Q, it works as expected: 
>
> sage: F = QQ 
> sage: x = polygen(F) 
> sage: u = F(1) 
> sage: x/u 
> x 
> sage: x//u 
> x 
>
> Bug?  I found out that the real name of the // operator is __floordiv, 
> and in the first example x.__floordiv?? displays the code, which 
> appears to tell me that when the two operands are of different types 
> (as here), the function bin_op(self, right, operator.mod) is returned. 
> The "operator.mod" looks like the culprit! 
>
> John 
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" 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/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to