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

Home » Public Forums » archive » Meaning of the expression
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Meaning of the expression [message #93638] Mon, 19 September 2016 23:05 Go to next message
Suresh Negi is currently offline  Suresh Negi
Messages: 28
Registered: August 2016
Junior Member
exp = 'BYTE(B1 NE 0)*1'

What is the meaning of this expression???
Re: Meaning of the expression [message #93640 is a reply to message #93638] Tue, 20 September 2016 01:05 Go to previous messageGo to next message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
On Tuesday, September 20, 2016 at 8:05:22 AM UTC+2, Sanu wrote:
> exp = 'BYTE(B1 NE 0)*1'
>
> What is the meaning of this expression???

It's not an expression, it's an assignment.
It assigns a string to the variable exp.
However, the math displayed in the string is somewhat strange:
- b1 NE 0 will always give a byte result, so there is no need for the byte function
- the *1 will convert the result to an integer or long (depending on the compiler options)

Helder
Re: Meaning of the expression [message #93641 is a reply to message #93640] Tue, 20 September 2016 02:39 Go to previous messageGo to next message
Markus Schmassmann is currently offline  Markus Schmassmann
Messages: 129
Registered: April 2016
Senior Member
On 09/20/2016 10:05 AM, Helder wrote:
> On Tuesday, September 20, 2016 at 8:05:22 AM UTC+2, Sanu wrote:
>> exp = 'BYTE(B1 NE 0)*1'
>>
>> What is the meaning of this expression???
> It's not an expression, it's an assignment.
> It assigns a string to the variable exp.
> However, the math displayed in the string is somewhat strange:
> - b1 NE 0 will always give a byte result, so there is no need for the byte function
> - the *1 will convert the result to an integer or long (depending on the compiler options)
- B1 NE 0 is of type BYTE with the Boolean flag set, the BYTE() function
removes that flag
- the only difference the Boolean flag makes, is to HELP,
ISA(XXX,/boolean) and implied print
- once *1 is applied, this does not matter

if compile_opt idl2 or defint32 is set, the math in the string could be
shortened to 'LONG(B1 NE 0)', otherwise 'FIX(B1 NE 0)'
Re: Meaning of the expression [message #93642 is a reply to message #93641] Tue, 20 September 2016 02:54 Go to previous messageGo to next message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
On Tuesday, September 20, 2016 at 11:39:39 AM UTC+2, Markus Schmassmann wrote:
> On 09/20/2016 10:05 AM, Helder wrote:
>> On Tuesday, September 20, 2016 at 8:05:22 AM UTC+2, Sanu wrote:
>>> exp = 'BYTE(B1 NE 0)*1'
>>>
>>> What is the meaning of this expression???
>> It's not an expression, it's an assignment.
>> It assigns a string to the variable exp.
>> However, the math displayed in the string is somewhat strange:
>> - b1 NE 0 will always give a byte result, so there is no need for the byte function
>> - the *1 will convert the result to an integer or long (depending on the compiler options)
> - B1 NE 0 is of type BYTE with the Boolean flag set, the BYTE() function
> removes that flag
> - the only difference the Boolean flag makes, is to HELP,
> ISA(XXX,/boolean) and implied print
> - once *1 is applied, this does not matter
>
> if compile_opt idl2 or defint32 is set, the math in the string could be
> shortened to 'LONG(B1 NE 0)', otherwise 'FIX(B1 NE 0)'

Hi Markus,
what version of IDL do you use?
I get very different results:
IDL> help, 0 NE 0
<Expression> BYTE = 0
IDL> help, isa(0b NE 0b, /boolean)
<Expression> BYTE = 0
IDL> !version
{
"ARCH": "x86_64",
"OS": "Win32",
"OS_FAMILY": "Windows",
"OS_NAME": "Microsoft Windows",
"RELEASE": "8.5.1",
"BUILD_DATE": "Nov 14 2015",
"MEMORY_BITS": 64,
"FILE_OFFSET_BITS": 64
}

The only way I can create a boolean is with the boolean function.
IDL> help, isa(boolean(0b NE 0b), /boolean)
<Expression> BYTE = 1
Even this does not return a boolean:
IDL> help, isa(boolean(0b) NE boolean(0b), /boolean)
<Expression> BYTE = 0

Cheers,
Helder
Re: Meaning of the expression [message #93643 is a reply to message #93642] Tue, 20 September 2016 06:55 Go to previous messageGo to next message
Markus Schmassmann is currently offline  Markus Schmassmann
Messages: 129
Registered: April 2016
Senior Member
On 09/20/2016 11:54 AM, Helder wrote:
> On Tuesday, September 20, 2016 at 11:39:39 AM UTC+2, Markus Schmassmann wrote:
>> On 09/20/2016 10:05 AM, Helder wrote:
>>> On Tuesday, September 20, 2016 at 8:05:22 AM UTC+2, Sanu wrote:
>>>> exp = 'BYTE(B1 NE 0)*1'
>>>>
>>>> What is the meaning of this expression???
>>> It's not an expression, it's an assignment.
>>> It assigns a string to the variable exp.
>>> However, the math displayed in the string is somewhat strange:
>>> - b1 NE 0 will always give a byte result, so there is no need for the byte function
>>> - the *1 will convert the result to an integer or long (depending on the compiler options)
>> - B1 NE 0 is of type BYTE with the Boolean flag set, the BYTE() function
>> removes that flag
>> - the only difference the Boolean flag makes, is to HELP,
>> ISA(XXX,/boolean) and implied print
>> - once *1 is applied, this does not matter
>>
>> if compile_opt idl2 or defint32 is set, the math in the string could be
>> shortened to 'LONG(B1 NE 0)', otherwise 'FIX(B1 NE 0)'
> what version of IDL do you use?
> I get very different results:
> IDL> help, 0 NE 0
> <Expression> BYTE = 0
> IDL> help, isa(0b NE 0b, /boolean)
> <Expression> BYTE = 0
> IDL> !version
> {
> "ARCH": "x86_64",
> "OS": "Win32",
> "OS_FAMILY": "Windows",
> "OS_NAME": "Microsoft Windows",
> "RELEASE": "8.5.1",
> "BUILD_DATE": "Nov 14 2015",
> "MEMORY_BITS": 64,
> "FILE_OFFSET_BITS": 64
> }
>
> The only way I can create a boolean is with the boolean function.
> IDL> help, isa(boolean(0b NE 0b), /boolean)
> <Expression> BYTE = 1
> Even this does not return a boolean:
> IDL> help, isa(boolean(0b) NE boolean(0b), /boolean)
> <Expression> BYTE = 0
Hi Helder,

your right, IDL logical operators give back BYTE and not BOOLEAN, which
doesn't seems very sensible to me. My answer reflects what I thought
should be instead of what is. Sorry for the confusion.

Cheers, Markus

PS: IDL> isa(!true,/boolean)
1
Re: Meaning of the expression [message #93646 is a reply to message #93638] Tue, 20 September 2016 23:10 Go to previous message
Suresh Negi is currently offline  Suresh Negi
Messages: 28
Registered: August 2016
Junior Member
On Tuesday, September 20, 2016 at 11:35:22 AM UTC+5:30, Sanu wrote:
> exp = 'BYTE(B1 NE 0)*1'
>
> What is the meaning of this expression???

What is meaning of *1
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: help needed in understanding correl_images
Next Topic: Need help to understand the meaning

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

Current Time: Wed Oct 08 09:18:59 PDT 2025

Total time taken to generate the page: 0.00559 seconds