Opened 12 years ago

Last modified 12 years ago

#32072 closed defect

Python: powers of two are screwed up starting at 2**63 — at Initial Version

Reported by: singingwolfboy@… Owned by: jyrkiwahlstedt
Priority: Normal Milestone:
Component: ports Version: 2.0.3
Keywords: Cc:
Port: python25 python27

Description

$ # debugging info
$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.7.2
BuildVersion:	11C74
singingwolfboy ~
$ uname -a
Darwin DBMBP.local 11.2.0 Darwin Kernel Version 11.2.0: Tue Aug  9 20:54:00 PDT 2011; root:xnu-1699.24.8~1/RELEASE_X86_64 x86_64
$ port installed python25 python27
The following ports are currently installed:
  python25 @2.5.6_2 (active)
  python27 @2.7.2_2+ucs4 (active)
$ # testing powers of two with system pythons
$ /usr/bin/python2.5 -c "print 2**62"
4611686018427387904
$ /usr/bin/python2.5 -c "print 2**63"
9223372036854775808
$ /usr/bin/python2.5 -c "print 2**64"
18446744073709551616
$ /usr/bin/python2.5 -c "print 2**65"
36893488147419103232
$ /usr/bin/python2.6 -c "print 2**62"
4611686018427387904
$ /usr/bin/python2.6 -c "print 2**63"
9223372036854775808
$ /usr/bin/python2.6 -c "print 2**64"
18446744073709551616
$ /usr/bin/python2.6 -c "print 2**65"
36893488147419103232
$ /usr/bin/python2.7 -c "print 2**62"
4611686018427387904
$ /usr/bin/python2.7 -c "print 2**63"
9223372036854775808
$ /usr/bin/python2.7 -c "print 2**64"
18446744073709551616
$ /usr/bin/python2.7 -c "print 2**65"
36893488147419103232
$ ####### WEIRDNESS BEGINS HERE ########
$ # testing powers of two with Macports pythons
$ /opt/local/bin/python2.5 -c "print 2**62"
4611686018427387904
$ /opt/local/bin/python2.5 -c "print 2**63"
-9223372036854775808
$ /opt/local/bin/python2.5 -c "print 2**64"
0
$ /opt/local/bin/python2.5 -c "print 2**65"
0
$ /opt/local/bin/python2.7 -c "print 2**62"
4611686018427387904
$ /opt/local/bin/python2.7 -c "print 2**63"
-9223372036854775808
$ /opt/local/bin/python2.7 -c "print 2**64"
0
$ /opt/local/bin/python2.7 -c "print 2**65"
0
$ # I have not tested Macports python2.4 or python2.6, but I bet it's the same
$ 

Change History (0)

Note: See TracTickets for help on using tickets.