Is the sky falling? [message #87192] |
Wed, 15 January 2014 05:20  |
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   |
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 #87197 is a reply to message #87194] |
Wed, 15 January 2014 05:44  |
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
|
|
|