These seem to be the offending lines from power_mod:
apow = a
while n&1 == 0:
apow = (apow*apow) % m
n = n >> 1
power = apow
Maybe the final line should be changed to
power = apow % m
- Alasdair
On Dec 22, 3:19 pm, "William Stein" <[email protected]> wrote:
> On Sun, Dec 21, 2008 at 5:03 PM, almis <[email protected]> wrote:
>
> > ----------------------------------------------------------------------
> > | SAGE Version 3.1.4, Release Date: 2008-10-16 |
> > | Type notebook() for the GUI, and license() for information. |
> > ----------------------------------------------------------------------
>
> > sage: power_mod(11,1,7)
> > 11
> > sage: mod(11^1,7)
> > 4
> > sage: # Hmmm...???
> > sage:
>
> > ...al
>
> Thanks. This is definitely a bug, which we are tracking here:
>
> htttp://trac.sagemath.org/sage_trac/ticket/4850
>
> William
--~--~---------~--~----~------------~-------~--~----~
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-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---