#15260: Integer division of rationals
-----------------------------+-------------------------
       Reporter:  ncohen     |        Owner:
           Type:  defect     |       Status:  new
       Priority:  major      |    Milestone:  sage-5.13
      Component:  numerical  |   Resolution:
       Keywords:             |    Merged in:
        Authors:             |    Reviewers:
Report Upstream:  N/A        |  Work issues:
         Branch:             |       Commit:
   Dependencies:             |     Stopgaps:
-----------------------------+-------------------------

Comment (by tmonteil):

 The reason is that for rationals (and apparently more generally for
 `FieldElement`), we have

 {{{
     def __floordiv__(self, other):
         return self / other
 }}}

 where it should be

 {{{
     def __floordiv__(self, other):
         return floor(self / other)
 }}}

 I will do a patch once i have compiled a more recent version of Sage

 What is fun is that

 {{{
 sage: RDF(0.5)//2
 0.25

 sage: RR(0.5)//2
 TypeError: unsupported operand type(s) for //:
 'sage.rings.real_mpfr.RealLiteral' and 'sage.rings.real_mpfr.RealNumber'
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/15260#comment:1>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

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

Reply via email to