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

Comment (by vdelecroix):

 Replying to [comment:49 mmezzarobba]:
 > > On a related note, I noticed that for `round` you need to test
 equality with elements of `ZZ + 1/2`.
 >
 > Couldn't you just compute ceil(x-1/2)?

 {{{
 sage: x = 0.5
 sage: print x.round() == (x-0.5).ceil()
 False
 }}}

--
Ticket URL: <https://trac.sagemath.org/ticket/12121#comment:54>
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