Re: Please explain... [message #5251] |
Mon, 27 November 1995 00:00 |
rivers
Messages: 228 Registered: March 1991
|
Senior Member |
|
|
In article <49ae2t$2gt@hammer.msfc.nasa.gov>, mallozzi@ssl.msfc.nasa.gov writes:
> Can someone explain this to me?
>
> IDL> .r
> - x = 0 & y = 0
> - case 1 of
> - x and y: print, '1'
> - NOT x and y: print, '2'
> - x and NOT y: print, '3'
> - NOT x and NOT y: print, '4'
> - endcase
> - end
> % Compiled module: $MAIN$.
> % Case statement found no matches.
> % Execution halted at $MAIN$ </dev/tty( 1)> .
> IDL> if NOT x and NOT y then print, '4'
> 4
> IDL>
This is an easy one. Case 4 would require the constant "1" to be equal to
NOT x and NOT y.
However the IDL NOT operator is a bitwise negation operator, hence (NOT x) is
equal to 'FFFF'x. (NOT x and NOT y) is also 'FFFF'X, which is -1.
____________________________________________________________
Mark Rivers (312) 702-2279 (office)
CARS (312) 702-9951 (secretary)
Univ. of Chicago (312) 702-5454 (FAX)
5640 S. Ellis Ave. (708) 922-0499 (home)
Chicago, IL 60637 rivers@cars3.uchicago.edu (Internet)
|
|
|