#6118: [with (new) second patch, needs review] integer shifting slow
------------------------------+---------------------------------------------
Reporter: robertwb | Owner: somebody
Type: defect | Status: new
Priority: major | Milestone: sage-4.0.3
Component: basic arithmetic | Keywords:
Reviewer: | Author:
Merged: |
------------------------------+---------------------------------------------
Comment(by craigcitro):
I've added a new version of the second patch, which mostly just adds
comments and removes the inconsistencies with things like `_lshift` and
`_rshift_`.
In particular, I've come around to Robert's point that we want to speed up
the `Integer << int` and `Integer >> int` cases the most -- I just did a
`search_src('>>')`, and there seems to be a lot of code that shifts by
literals (which will be Python `int`s). I also removed the one extra error
check in `_shift_helper` and made a note about it.
One last question, though -- do we really need the case where `y = ZZ(y)`
raises a `ValueError`? Looking at the `Integer` constructor, this seems to
only happen when we're given a string in a base larger than 36; in this
case, the code in the `except` clause won't work, anyway. So are there
other cases where this is used that I'm not thinking of? (It's obviously
not too important, but I'm curious.)
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6118#comment:7>
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
-~----------~----~----~----~------~----~------~--~---