0

I have a 64 bit machine with 64 bit Windows on one side and 64 bit Ubuntu 14 on the other. I am going through some exercises and notice that when I run the following command:

import sys
sys.maxint

I don’t get back the max int for a 64 bit machine and install I get the 32 bit max int. I’m a bit confused and do not know where to start. Maybe it is because I am using the Student License? Works just fine on the Ubuntu side.

Giacomo1968
  • 25,759
  • 11
  • 71
  • 103
MCP_infiltrator
  • 3,961
  • 10
  • 45
  • 82
  • @Jake this question is about using Python, a programming language, on two different OS platforms. The exercises to which the poster refers would seem to be programming exercises. Questions about using Enthought Canopy, a Python distribution with libraries, for use in writing scientific computer programs, are asked in Stack Overflow. Granted that most posters are not professional programmers. – Jonathan March May 17 '14 at 02:06
  • 1
    @jonathanmarch I stand corrected! – Giacomo1968 May 17 '14 at 02:12
  • possible duplicate of [Python sys.maxint, sys.maxunicode on Linux and windows](http://stackoverflow.com/questions/8164832/python-sys-maxint-sys-maxunicode-on-linux-and-windows) – David Zemens May 17 '14 at 02:24

1 Answers1

2

The value of sys.maxint depends on the underlying C library. What you are seeing is expected behavior on Windows. See Python sys.maxint, sys.maxunicode on Linux and windows https://mail.python.org/pipermail/python-list/2008-December/504337.html

The question is a good one, but it could reasonably be marked as a duplicate by someone with sufficient "reputation". Please search before asking questions. Enjoy Python!

Community
  • 1
  • 1
Jonathan March
  • 5,800
  • 2
  • 14
  • 16
  • In addition to the comments about `longint` in the above-linked article, note that if you are working with arrays, then you should be using numpy which allows explicit specification of types, e.g. `numpy.int64` – Jonathan March May 17 '14 at 02:40