#6118: [with second patch, needs review] integer shifting slow
------------------------------+---------------------------------------------
 Reporter:  robertwb          |       Owner:  somebody  
     Type:  defect            |      Status:  new       
 Priority:  major             |   Milestone:  sage-4.0.1
Component:  basic arithmetic  |    Keywords:            
------------------------------+---------------------------------------------

Comment(by robertwb):

 I just realized this touched integer.pxd, so some comments first. We care
 about shifting by ints a lot because library code (especially mpmath) does
 a lot of stuff like "x << 1". I think the patch may make that path slower.
 Also, the error checking and cpdefing may make it slower too (I'll test,
 might be negligible).

 Also, why do

 {{{
 if n < 0:
     n *= -1
     sign *= -1
 }}}

 rather than

 {{{
 n *= sign
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6118#comment:5>
Sage <http://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