NEQV(3M) Last changed: 1-6-98
NEQV, XOR - Computes logical difference
NEQV ([I=]i,[J=]j)
XOR ([I=]i,[J=]j)
UNICOS, UNICOS/mk, and IRIX systems
Compiler extension to Fortran 90
NEQV and XOR are two names for the same routine. NEQV and XOR are
elemental functions for the CF90 compiler.
arg and i and j can be of type Boolean, integer, real, logical, or
Cray pointer.
These routines are outmoded for the CF90 compiler. Refer to the
Fortran Language Reference Manual, Volume 3, publication SR-3905, for
information about outmoded features and their preferred standard
alternatives. The name of this intrinsic cannot be passed as an
argument.
Unexpected results can occur when Boolean functions are declared
external and then used with logical arguments. The external Boolean
functions always treat their arguments as type Boolean and return a
Boolean result on UNICOS and UNICOS/mk systems. On IRIX systems, they
return an integer result.
When given two arguments of type logical, NEQV and XOR compute a
logical difference and return a logical result. When given two
arguments of type Boolean, integer, real, or pointer, NEQV and XOR
compute a bit-wise logical difference and return a Boolean result. No
type conversion occurs.
The following tables show both the logical difference and bit-wise
logical difference. NEQV is shown in the tables, but XOR produces
identical results.
-----------------------------------------------------------------
Logical Logical (Logical Variable 1) NEQV
Variable 1 Variable 2 (Logical Variable 2)
-----------------------------------------------------------------
T T F
T F T
F T T
F F F
-----------------------------------------------------------------
--------------------------------------------------------------
Bit of Bit of (Bit of Variable 1) NEQV
Variable 1 Variable 2 (Bit of Variable 2)
--------------------------------------------------------------
1 1 0
1 0 1
0 1 1
0 0 0
--------------------------------------------------------------
The following section of Fortran code shows the NEQV function used
with two arguments of type logical. XOR is used in the same manner
and produces the same results.
LOGICAL L1, L2, L3
...
L3 = NEQV(L1,L2)
The following section of Fortran code shows the NEQV function used
with two arguments of type integer. XOR is used in the same manner
and produces the same results. The bit patterns of the arguments and
results are also given. For clarity, only the rightmost 8 bits are
shown.
INTEGER I1, I2, I3
I1 = 12
I2 = 10
...
I3 = NEQV(I1,I2)
------------------------------- -------------------------------
| 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 |
------------------------------- -------------------------------
I1 I2
-------------------------------
| 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 |
-------------------------------
I3
Intrinsic Procedures Reference Manual, publication SR-2138, for the
printed version of this man page.
NEQV(3M) Last changed: 1-6-98
NEQV, XOR - Computes logical difference
NEQV ([I=]i,[J=]j)
XOR ([I=]i,[J=]j)
UNICOS, UNICOS/mk, and IRIX systems
Compiler extension to Fortran 90
NEQV and XOR are two names for the same routine. NEQV and XOR are
elemental functions for the CF90 compiler.
arg and i and j can be of type Boolean, integer, real, logical, or
Cray pointer.
These routines are outmoded for the CF90 compiler. Refer to the
Fortran Language Reference Manual, Volume 3, publication SR-3905, for
information about outmoded features and their preferred standard
alternatives. The name of this intrinsic cannot be passed as an
argument.
Unexpected results can occur when Boolean functions are declared
external and then used with logical arguments. The external Boolean
functions always treat their arguments as type Boolean and return a
Boolean result on UNICOS and UNICOS/mk systems. On IRIX systems, they
return an integer result.
When given two arguments of type logical, NEQV and XOR compute a
logical difference and return a logical result. When given two
arguments of type Boolean, integer, real, or pointer, NEQV and XOR
compute a bit-wise logical difference and return a Boolean result. No
type conversion occurs.
The following tables show both the logical difference and bit-wise
logical difference. NEQV is shown in the tables, but XOR produces
identical results.
-----------------------------------------------------------------
Logical Logical (Logical Variable 1) NEQV
Variable 1 Variable 2 (Logical Variable 2)
-----------------------------------------------------------------
T T F
T F T
F T T
F F F
-----------------------------------------------------------------
--------------------------------------------------------------
Bit of Bit of (Bit of Variable 1) NEQV
Variable 1 Variable 2 (Bit of Variable 2)
--------------------------------------------------------------
1 1 0
1 0 1
0 1 1
0 0 0
--------------------------------------------------------------
The following section of Fortran code shows the NEQV function used
with two arguments of type logical. XOR is used in the same manner
and produces the same results.
LOGICAL L1, L2, L3
...
L3 = NEQV(L1,L2)
The following section of Fortran code shows the NEQV function used
with two arguments of type integer. XOR is used in the same manner
and produces the same results. The bit patterns of the arguments and
results are also given. For clarity, only the rightmost 8 bits are
shown.
INTEGER I1, I2, I3
I1 = 12
I2 = 10
...
I3 = NEQV(I1,I2)
------------------------------- -------------------------------
| 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 |
------------------------------- -------------------------------
I1 I2
-------------------------------
| 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 |
-------------------------------
I3
Intrinsic Procedures Reference Manual, publication SR-2138, for the
printed version of this man page.
[ Back ]
|