#15260: Integer division of reals and rationals
-------------------------------------+-------------------------------------
       Reporter:  ncohen             |        Owner:
           Type:  defect             |       Status:  needs_work
       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 jdemeyer):

 * status:  needs_info => needs_work


Comment:

 Replying to [comment:18 tmonteil]:
 > 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 ?
 Because I wanted something which behaves like `contains_zero()` but still
 works for any kind of element (unfortunately, `__floordiv__` doesn't use
 the coercion system).

 > 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:
 >
 > What about trying `(self/other).floor()` and raising a
 `NotImplementedError` if the method does not exist ?
 That's outside the scope of this ticket, but something like that could be
 done in a new ticket or as part of #2034.

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