gmpy moving to code.google.com
Daniel Nogradi
nogradi at gmail.com
Wed Feb 28 15:22:03 EST 2007
> Could you please tell me, on that 64-bit build, what happens with:
>
> >>> import gmpy, sys, operator
> >>> sys.maxint
> ???
> >>> gmpy.mpz(sys.maxint)
> ???
> >>> operator.index(gmpy.mpz(sys.maxint))
> ???
> >>> sys.maxint+1
> ???
> >>> gmpy.mpz(sys.maxint+1)
> ???
> >>> operator.index(gmpy.mpz(sys.maxint)+1)
> ???
>
> i.e., what are the values correspondiing to the ??? occurrences when
> you actually do that...?
Here it goes (python 2.5 - 64bit):
>>> import gmpy, sys, operator
>>> sys.maxint
9223372036854775807
>>> gmpy.mpz(sys.maxint)
mpz(-1)
>>> operator.index(gmpy.mpz(sys.maxint))
-1
>>> sys.maxint+1
9223372036854775808L
>>> gmpy.mpz(sys.maxint+1)
mpz(9223372036854775808L)
>>> operator.index(gmpy.mpz(sys.maxint)+1)
0
I don't pretent to fully understand what's going on, but
gmpy.mpz(sys.maxint)==gmpy.mpz(-1) is more than suspicious :)
More information about the Python-list
mailing list