[Date Index] [Thread Index] [Author Index]
Re: big integer for Range
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 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:= r = Range[10^9] The kernel dies, without any warning or error message. Starting a new session, In:= 2^32 - 1 Out= 4294967295 In:= r = Range[2^32 - 1]; From In:= Range::range: Range specification in Range is not a machine-size \ integer. That time I can get the same message as yours and the kernel is still here :-) In:= 2^31 - 1 Out= 2147483647 In:= r = Range[2^31 - 1]; Now this is a machine-size integer but again, the kernel dies without any warning. In:= Length[r] Out= 0 In:= Developer`$MaxMachineInteger Out= 2147483647 In:= $Version Out= "5.2 for Microsoft Windows (June 20, 2005)" I like Mathematica for the consistency of its behavior :-) Best regards, /J.M.