Changes between Initial Version and Version 1 of Ticket #13256


Ignore:
Timestamp:
07/14/12 18:54:19 (10 years ago)
Author:
vdelecroix
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #13256

    • Property Status changed from new to needs_review
  • Ticket #13256 – Description

    initial v1  
    1 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.
     1Implementation of absolute value (abs), floor (floor) and ceiling (ceil) function for elements in quadratic number field.
    22
    3 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.
    4 {{{
    5 sage: sage: K.<sqrt2> = QuadraticField(2, name='sqrt2')
    6 sage: %timeit abs(sqrt2)
    7 125 loops, best of 3: 2.22 ms per loop
    8 sage: %timeit floor(sqrt2)
    9 625 loops, best of 3: 3.37 µs per loop
    10 }}}
     3The function abs depends on the function sign implemented in tickets #7160 and #13213.