#13256: abs floor ceil for quadratic number field
-----------------------------+----------------------------------------------
   Reporter:  vdelecroix     |             Owner:  vdelecroix                   
                          
       Type:  enhancement    |            Status:  new                          
                          
   Priority:  major          |         Milestone:  sage-5.3                     
                          
  Component:  number fields  |          Keywords:  absolute value, floor, 
ceiling, number field, quadratic
Work issues:                 |   Report Upstream:  N/A                          
                          
  Reviewers:                 |           Authors:  Vincent Delecroix            
                          
  Merged in:                 |      Dependencies:  #7160, #13213                
                          
   Stopgaps:                 |  
-----------------------------+----------------------------------------------
 Implementation of absolute value (abs), floor (floor) and ceiling (ceil)
 function for elements in quadratic number field. This depends (not very
 much) on comparisons in quadratic number fields implemented in tickects
 #7160 and #13213.

 Strangely enough, floor and ceil functions are much faster than abs
 function! The reason is because the comparison in #13213 which is called
 in abs is actually very slow.
 {{{
 sage: sage: K.<sqrt2> = QuadraticField(2, name='sqrt2')
 sage: %timeit abs(sqrt2)
 125 loops, best of 3: 2.22 ms per loop
 sage: %timeit floor(sqrt2)
 625 loops, best of 3: 3.37 µs per loop
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13256>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to