Re: big integer for Range
- To: mathgroup at smc.vnet.net
- Subject: [mg61270] Re: big integer for Range
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Fri, 14 Oct 2005 05:54:23 -0400 (EDT)
- Organization: The Open University, Milton Keynes, UK
- References: <diktip$515$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Murray Eisenberg wrote: > Mathematica 5.2 under Windows XP on a 32-bit machine complains if I ask > it to form Range[10^9]. The error is Range::range: Range specification > in Range[10000000000] is not a machine-size integer. > Hi Murray, You are lucky because on my system (XP 32 bits) the kernel dies without any warning (see below)! > Is there a built-in Mathematica function that tells what the machine's > maximum machine-size integer is? (And if not, shouldn't there be?) > *Developer`$MaxMachineInteger* does that. Here what I got on my machine. In[1]:= r = Range[10^9] The kernel dies, without any warning or error message. Starting a new session, In[1]:= 2^32 - 1 Out[1]= 4294967295 In[2]:= r = Range[2^32 - 1]; From In[2]:= Range::range: Range specification in Range[4294967295] is not a machine-size \ integer. That time I can get the same message as yours and the kernel is still here :-) In[3]:= 2^31 - 1 Out[3]= 2147483647 In[4]:= r = Range[2^31 - 1]; Now this is a machine-size integer but again, the kernel dies without any warning. In[1]:= Length[r] Out[1]= 0 In[2]:= Developer`$MaxMachineInteger Out[2]= 2147483647 In[3]:= $Version Out[3]= "5.2 for Microsoft Windows (June 20, 2005)" I like Mathematica for the consistency of its behavior :-) Best regards, /J.M.