> It always returns 101, not a random prime of 100 bit integer.

That's because in Python/Cython, the carat ^ isn't exponentiation,
it's bitwise xor.  The most general solution is to use **:

Python 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 15:22:34)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 2^(100-1)
97
>>> 2^(100)
102
>>> 2**(100-1)
633825300114114700748351602688L
>>> 2**(100)
1267650600228229401496703205376L


Doug

-- 
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
URL: http://www.sagemath.org

Reply via email to