HTBasic Help
×
Menu
Index

BINEQV

Performs a bit by bit equivalence operation.
 
 BINEQV( arg, arg )
 
Where:
arg = numeric-expression rounded to an INTEGER
 
Usage:
J=BINEQV(&HFF00,Var)
I=BINEQV(15,J)
 
Example:     BINEQV.BAS
 
Description:
The result of BINEQV(A,B) is calculated by converting A and B to integer values. Then each bit of the result is set to 1 if the corresponding bits in A and B are equal. This table illustrates this relationship.
 
A
B
BINEQV(A,B)
0
0
1
0
1
0
1
0
0
1
1
1
 
The following example performs a bit by bit equivalence of 12 and 6:
 
BINEQV(12,6)
 
12           = 0000000000001100
6            = 0000000000000110
BINEQV(12,6) = 1111111111110101
 
The resulting binary number represents -11.
 
See Also: