#15260: Integer division of reals and rationals
-------------------------------------+-------------------------------------
       Reporter:  ncohen             |        Owner:
           Type:  defect             |       Status:  needs_info
       Priority:  major              |    Milestone:  sage-6.4
      Component:  basic arithmetic   |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Jan Keitel,        |    Reviewers:  Jeroen Demeyer,
  Jeroen Demeyer                     |  Thierry Monteil
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/jdemeyer/ticket/15260            |  a7dde8bebc558d4f3a7cff9f6c26dab40e2ec55b
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------
Changes (by tmonteil):

 * status:  needs_review => needs_info
 * reviewer:  Jeroen Demeyer => Jeroen Demeyer, Thierry Monteil


Comment:

 The condition `if not other != 0:` looks weird. For real interval fields,
 why not using `other.contains_zero()` which is both easier to understand
 and faster ?

 I do not understand the ad-hoc coercion that is made for `RealNumber`
 where the precision of `self` takes predecence over the one of `other`.

 Concerning `FieldElement` it is very dangerous to return the usual
 division, since it will silently fail when the field in a subset of the
 reals for which we did not define a `__floordiv__` method:

 {{{
 sage: RLF(5) // 2
 2.5000000000000000?
 sage: AA(5) // 2
 5/2
 }}}

 What about trying `(self/other).floor()` and raising a
 `NotImplementedError` if the method does not exist ?

--
Ticket URL: <http://trac.sagemath.org/ticket/15260#comment:18>
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/d/optout.

Reply via email to