V+ 12.4 Release Notes

Displays the Table of Contents for the current document
Displays the previous topic in the current document
Displays the next topic in the current document
Displays the Index for the current document

... value BOR value ...

 
Function

Perform the binary OR operation on two values.

Usage Considerations

The BOR operation is meaningful only when performed on integer values.

Details

The BOR operator can be used to perform a binary OR operation on two values on a bit-by-bit basis, resulting in a real value. Note, however, that this operation is meaningful only when performed on integer values.

Specifically, the BOR operation consists of the following steps:

1. Convert the operands to sign-extended 32-bit integers, truncating any fractional part.

2. Perform a binary OR operation (see below).

3. Convert the result back to a real value.

During the binary OR operation,

c = a BOR b 

the bits in the resultant C statement are determined by comparing the corresponding bits in the operands A and B as indicated in Combining A and B Operands Using the BOR Operator.

Table 2-2. Combining A and B Operands Using the BOR Operator
For each bit in:
a
b

c
0
0
->
0
0
1
->
1
1
0
->
1
1
1
->
1

That is, a bit in the result will be 1 if the corresponding bit in either of the operands is 1.

Refer to the V+ Language User's Guide for the order in which operators are evaluated within expressions.

Example s

Consider the following (binary values are shown only to make the operation more evident):

^B101000 BOR ^B100001 yields ^B101001 (41)

Note that a very different result is obtained with the logical OR operation:

^B101000 OR ^B100001 yields -1 (TRUE)

In this case, ^B101000 and ^B100001 are each interpreted as logically TRUE since they are nonzero.

Related Keyword s

... value BAND value ... (operator)

... value BXOR value ... (operator)

OR (operator)

Syntax
BXOR-I
... value BXOR value ...
 
Function

Perform the binary exclusive-OR operation on two values.

Usage Considerations

The BXOR operation is meaningful only when performed on integer values.

Details

The BXOR operator can be used to perform a binary exclusive-OR operation on two values on a bit-by-bit basis, resulting in a real value. Note, however, that this operation is meaningful only when performed on integer values.

Specifically, the BXOR operation consists of the following steps:

1. Convert the operands to sign-extended 24-bit integers, truncating any fractional part.

2. Perform a binary exclusive-OR operation (see below).

3. Convert the result back to a real value.

During the binary exclusive-OR operation,

c = a BXOR b 

the bits in the resultant C are determined by comparing the corresponding bits in the operands A and B as indicated in Combining A and B Operands Using the BXOR Operator.
Table 2-3. Combining A and B Operands Using the BXOR Operator
For each bit in:
a
b

c
0
0
->
0
0
1
->
1
1
0
->
1
1
1
->
0

That is, a bit in the result will be 1 if the corresponding bit in one (and only one) of the operands is 1.

Refer to the V+ Language User's Guide for the order in which operators are evaluated within expressions.

Example s

Consider the following (binary values are shown only to make the operation more evident):

^B101000 BXOR ^B100001 yields ^B001001 (9)

Note that a very different result is obtained with the logical XOR operation:

^B101000 XOR ^B100001 yields 0 (FALSE)

In this case, ^B101000 and ^B100001 are each interpreted as logically TRUE since they are nonzero.

Related Keyword s

... value BAND value ... (operator)

... value BOR value ... (operator)

XOR (operator)

Syntax
FSET-I

Please submit comments to: techpubs@adept.com

Last modified on: 07/08/2004
Copyright © 2004 by Adept Technology, Inc.
All rights reserved.