Max number of elements in an array [message #53905] |
Tue, 08 May 2007 14:34  |
Jean H.
Messages: 472 Registered: July 2006
|
Senior Member |
|
|
Hi all,
I can't remember this... what is the type of the variable used to index
an array? ... in other words, what is the max number of elements an
array can hold, provided the memory is available? Is there a way to
change that, so I can use, let's say, an unsigned long 64?
Thanks,
Jean
|
|
|
Re: Max number of elements in an array [message #54018 is a reply to message #53905] |
Mon, 14 May 2007 09:18  |
Jean H.
Messages: 472 Registered: July 2006
|
Senior Member |
|
|
> In the 32-bits version, signed longs are used.
> Thus the max number of elements of a byte array is (2^31-offset),
> where offset is a small number (around 10).
>
> IDL 64 bit uses signed double precision longs, and the max number
> of elements in a byte array is (2^63-offset) [here the offset seems
> to be around 512].
>
> For other numeric types, divide the above numbers by the size in
> bytes of one element.
>
> Ciao,
> Paolo
Thanks Paolo! Exactly what I was looking for!
Jean
|
|
|
Re: Max number of elements in an array [message #54021 is a reply to message #53905] |
Mon, 14 May 2007 05:48  |
Paolo Grigis
Messages: 171 Registered: December 2003
|
Senior Member |
|
|
Jean H. wrote:
> Hi all,
>
> I can't remember this... what is the type of the variable used to index
> an array? ... in other words, what is the max number of elements an
> array can hold, provided the memory is available? Is there a way to
> change that, so I can use, let's say, an unsigned long 64?
In the 32-bits version, signed longs are used.
Thus the max number of elements of a byte array is (2^31-offset),
where offset is a small number (around 10).
IDL 64 bit uses signed double precision longs, and the max number
of elements in a byte array is (2^63-offset) [here the offset seems
to be around 512].
For other numeric types, divide the above numbers by the size in
bytes of one element.
Ciao,
Paolo
>
> Thanks,
>
> Jean
|
|
|