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

Home » Public Forums » archive » Re: Bug in operator precedence
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: Bug in operator precedence [message #45181 is a reply to message #45180] Tue, 16 August 2005 01:43 Go to previous message
Foldy Lajos is currently offline  Foldy Lajos
Messages: 268
Registered: October 2001
Senior Member
Hi,

print, ~1+1, (~1)+1, ~(1+1) gives 1 1 0, which shows, that ~ has
precedence greater or equal to addition. According to the documentation,
this is clearly wrong (and GDL is right printing 0 1 0).

By the way, in GDL print, NOT 1+1, (NOT 1)+1, NOT (1+1) gives -3 -1 -3,
which should be -1 -1 -3, because the precedence of NOT is equal to
addition (and IDL is right).

Now, we have two similar bugs, and the efforts needed to fix them are
equal. Which bug will be fixed first? (I would bet on GDL's bug fixed
in a few days.)

Ready, Steady, Go! :-))))))))

regards,
lajos



On Tue, 16 Aug 2005, m_schellens@hotmail.com wrote:

> According to the manual, operators
>
> ~ || &&
>
> have lower precedence than
>
> AND OR XOR
>
> Now I get:
> IDL> print, 1 && ~3 and 4
> 0
> IDL> print, 1 && (~3) and 4
> 0
> IDL> print, 1 && ~(3 and 4)
> 1
>
> I would consider this as a bug.
> Anybody agree or am I missing something?
>
> Cheers,
> marc
>
>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Install ENVI/IDL on cygwin
Next Topic: Re: Install ENVI/IDL on cygwin

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

Current Time: Wed Oct 08 15:50:21 PDT 2025

Total time taken to generate the page: 0.00451 seconds