#12121: floor/ceil can be very slow at integral values
-------------------------------------+-------------------------------------
       Reporter:  dsm                |        Owner:  AlexGhitza
           Type:  defect             |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-7.2
      Component:  basic arithmetic   |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Vincent Delecroix  |    Reviewers:  Marc Mezzarobba
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/vdelecroix/12121                 |  0e9b2f21d6a6bc42e35302316ac0f6b3b7451450
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by vdelecroix):

 Replying to [comment:41 vdelecroix]:
 > Replying to [comment:39 mmezzarobba]:
 > > * do we really need two loops that do essentially the same thing
 (including raising errors with the exact same message)?
 >
 > The equality test is potentially costly. And we want to avoid it as much
 as possible. In particular, it makes no sense to test this equality within
 each step of the loop as it is in your version. On a related note, I
 noticed that for `round` you need to test equality with elements of `ZZ +
 1/2`.

 And I also would like to use the very same function `incremental_rounding`
 for elements of `QQbar`. For the very same reason, you only want very
 lately the equality test.

--
Ticket URL: <http://trac.sagemath.org/ticket/12121#comment:42>
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 https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to