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

Home » Public Forums » archive » Is the sky falling?
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
Is the sky falling? [message #87192] Wed, 15 January 2014 05:20 Go to next message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
Hi,
I couldn't find any reference to explain this, so here is probably the typical beginners post.
Why is does the INTARR(3,3)+1 expression result in a LONG array?

IDL> HELP, INTARR(3,3)+1
<Expression> LONG = Array[3, 3]

Shouldn't it be an integer array?

On the other hand:

IDL> HELP, INTARR(3,3)+1b
<Expression> INT = Array[3, 3]

results in an integer array...

Where is the trick?

Regards,
Helder
Re: Is the sky falling? [message #87193 is a reply to message #87192] Wed, 15 January 2014 05:30 Go to previous messageGo to next message
Moritz Fischer is currently offline  Moritz Fischer
Messages: 32
Registered: June 2013
Member
With IDL 8.2.3 on Solaris and 8.1 on Windows I get INTs in either case.
Have you tried INTARR(3,3) + 1S ?


Am 15.01.2014 14:20, schrieb Helder:
> Hi, I couldn't find any reference to explain this, so here is
> probably the typical beginners post. Why is does the INTARR(3,3)+1
> expression result in a LONG array?
>
> IDL> HELP, INTARR(3,3)+1 <Expression> LONG = Array[3, 3]
>
> Shouldn't it be an integer array?
>
> On the other hand:
>
> IDL> HELP, INTARR(3,3)+1b <Expression> INT = Array[3, 3]
>
> results in an integer array...
>
> Where is the trick?
>
> Regards, Helder
>
Re: Is the sky falling? [message #87194 is a reply to message #87192] Wed, 15 January 2014 05:34 Go to previous messageGo to next message
Matthew Argall is currently offline  Matthew Argall
Messages: 286
Registered: October 2011
Senior Member
> Why is does the INTARR(3,3)+1 expression result in a LONG array?

Check to see f "1" is a long integer by typing.

IDL> help, 1

If it is, maybe there is a "compile_opt" somewhere.
Re: Is the sky falling? [message #87196 is a reply to message #87192] Wed, 15 January 2014 05:41 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Helder writes:

> I couldn't find any reference to explain this, so here is probably the typical beginners post.
> Why is does the INTARR(3,3)+1 expression result in a LONG array?
>
> IDL> HELP, INTARR(3,3)+1
> <Expression> LONG = Array[3, 3]
>
> Shouldn't it be an integer array?

I certainly get integers. Are you sure you don't have the INT32 compiler
option on?

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: Is the sky falling? [message #87197 is a reply to message #87194] Wed, 15 January 2014 05:44 Go to previous message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
On Wednesday, January 15, 2014 2:34:54 PM UTC+1, Matthew Argall wrote:
>> Why is does the INTARR(3,3)+1 expression result in a LONG array?
>
>
>
> Check to see f "1" is a long integer by typing.
>
>
>
> IDL> help, 1
>
>
>
> If it is, maybe there is a "compile_opt" somewhere.

Hi,
thanks for the answers.
Here is my situation:
IDL> !VERSION
{
ARCH: "x86_64",
OS: "Win32",
OS_FAMILY: "Windows",
OS_NAME: "Microsoft Windows",
RELEASE: "8.3",
BUILD_DATE: "Nov 15 2013",
MEMORY_BITS: 64,
FILE_OFFSET_BITS: 64
}
IDL> HELP, 1
<Expression> INT = 1
IDL> HELP, INTARR(3,3) + 1S
<Expression> INT = Array[3, 3]

Ok,
it seems like Compile_opt is making this. I just noticed that I got this result while debugging through some code where the "Compile_Opt idl2" option was used.
This clears things out. From the IDL help:
"DEFINT32 — IDL should assume that lexical integer constants default to the 32-bit type rather than the usual default of 16-bit integers..."

My error. I forgot that
1) I was debugging
2) Compile_opt idl2 was on
3) That idl2 makes 32-bit default integers

Thanks for pointing this out.

Cheers,
h
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: BVLS (NNLS) without loops?
Next Topic: Coyote Library Updated

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

Current Time: Wed Oct 08 15:07:40 PDT 2025

Total time taken to generate the page: 0.00431 seconds