comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Max number of elements in an array
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Max number of elements in an array [message #53905] Tue, 08 May 2007 14:34 Go to next message
Jean H. is currently offline  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 Go to previous message
Jean H. is currently offline  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 Go to previous message
Paolo Grigis is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: reading in images
Next Topic: Re: Fourier fit

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:27:47 PDT 2025

Total time taken to generate the page: 0.00691 seconds