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 #88104 is a reply to message #88099] Thu, 20 March 2014 10:01 Go to previous messageGo to previous message
Karl[1] is currently offline  Karl[1]
Messages: 79
Registered: October 2005
Member
On Thursday, March 20, 2014 3:24:59 AM UTC-6, Rob Klooster wrote:
> The reason it does not work, is that you first try to define +32768 and then negate the result. Since +32768 can only be expressed as a long, you end up with a long variable. Using fix is a solution, but you could also use the bitwise not operator, if you feel adventurous:
>
> IDL> a = not 32767
>
> IDL> help, a
>
> A INT = -32768

And whether this is a "bug" in IDL or not depends on how IDL defines literal constants.

If an IDL (integral) constant has the form (excuse my abuse of regex):

[+-][0-9]*

then one could argue this is be a bug.

If a constant can be only:

[0-9]*

then, the '-' is taken as an operator and this would not be considered an IDL bug.

C allows:

short a = -32768;

but warns about:

short a = -32769;

on a machine where a short is 16 bits.
[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 18:24:32 PDT 2025

Total time taken to generate the page: 0.00504 seconds