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

Home » Public Forums » archive » Re: negation operator
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: negation operator [message #49320 is a reply to message #49296] Thu, 13 July 2006 09:35 Go to previous messageGo to previous message
Foldy Lajos is currently offline  Foldy Lajos
Messages: 268
Registered: October 2001
Senior Member
Hi,

On Thu, 13 Jul 2006, JD Smith wrote:

> IDL> a=1
> IDL> print,~++a
> 0
>
> but how about:
>
> IDL> print,~-a
>
> print,~-a
> ^
> % Syntax error.
>
> This *should* work. Negation is priority 5, logical negation is
> priority 8, so it should evaluate -a first, and then ~(-a). Not sure
> if this should be considered a bug or just a weakness of the
> interpreter.
>

well, this should work according to the documentation, but does not.
I think this is a bug in the documentation, logical negation has the
same precedence as bitwise negation and unary -. IDL/GDL/FL agree on this.

regards,
lajos
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Mac OS X: Creating PDF figures from within IDL
Next Topic: Re: IDL and Macs. Speed is not only about squared roots

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

Current Time: Sat Oct 11 11:52:16 PDT 2025

Total time taken to generate the page: 2.16051 seconds