#10596: Misc improvements to arithmetic
--------------------------------+-------------------------------------------
   Reporter:  spancratz         |       Owner:  AlexGhitza
       Type:  enhancement       |      Status:  new       
   Priority:  major             |   Milestone:  sage-4.6.2
  Component:  basic arithmetic  |    Keywords:            
     Author:  spancratz         |    Upstream:  N/A       
   Reviewer:                    |      Merged:            
Work_issues:                    |  
--------------------------------+-------------------------------------------
 Generic code clean-up such as line breaks, empty lines etc

 ``n.digits()``

 Before:
 {{{
 sage: n = 10**10000000-10**9999990
 sage: timeit('n.ndigits()')
 625 loops, best of 3: 46.6 µs per loop
 sage: timeit('(-n).ndigits()')
 25 loops, best of 3: 9.04 ms per loop
 }}}
 {{{
 sage: ZZ(0).ndigits()
 0
 sage: ZZ(0).ndigits(base=2)
 0
 sage: ZZ(0).nbits()
 1
 }}}

 After:
 {{{
 sage: n = 10**10000000-10**9999990
 sage: timeit('n.ndigits()')
 625 loops, best of 3: 1.02 µs per loop
 sage: timeit('(-n).ndigits()')
 125 loops, best of 3: 4.57 ms per loop
 }}}
 {{{
 sage: ZZ(0).ndigits()
 1
 sage: ZZ(0).ndigits(base=2)
 1
 sage: ZZ(0).nbits()
 1
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10596>
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