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

Home » Public Forums » archive » -32768
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: -32768 [message #88111 is a reply to message #88108] Thu, 20 March 2014 16:44 Go to previous messageGo to previous message
chris_torrence@NOSPAM is currently offline  chris_torrence@NOSPAM
Messages: 528
Registered: March 2007
Senior Member
On Thursday, March 20, 2014 3:30:49 PM UTC-6, Yngvar Larsen wrote:
>
>
> IDL> help, -9223372036854775808LL
>
> <Expression> LONG64 = -9223372036854775808
>
> IDL> help, -9223372036854775809LL
>
> <Expression> LONG64 = 9223372036854775807
>
>
>
> Thus, we have the same bug for 32-bit integers, but not for 64-bit!!
>
>

Not to start a flame war, but I would argue that 64-bit has the bug, and that 16-bit and 32-bit are behaving correctly. It seems bad that the 64-bit case is quietly returning what could arguably be the wrong value.

As an aside, in the original post, the user stated that they want to "set an integer variable..." But in IDL, there is no such thing as an "integer variable" because IDL is loosely typed. There are just variables that happen to have integer type, but only after they've been created.

Jim P. is correct that the minus sign is really an operator. So it really is a runtime error to write "a = 32768s", regardless of whether you are then going to take the negative of it.

Cheers,
Chris
ExelisVIS
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Killing Widget Objects
Next Topic: How to choose the pixels along a curve in an image

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

Current Time: Wed Oct 08 20:06:06 PDT 2025

Total time taken to generate the page: 0.41211 seconds