BIN_OR()

BIN_OR(V1,V2)

RETURNS THE BINARY LOGICAL "OR" BETWEEN THE VALUES V1 AND V2

  • Type: Function
  • Parameters: 2
  • Group: Mathematics

ACTION

The function BIN_OR(V1,V2) returns the value of the binary logical "OR" between V1 and V2.

V1 and V2 are data or variables which can be real or integer.

If a value is real, it is rounded to the nearest integer before the logical operation.

The logical operation is made bit-by-bit:

1 OR 1 = 1

1 OR 0 = 1

0 OR 1 = 1

0 OR 0 = 0

Application:

to force a bit to 1

After V1=BIN_OR(V1,1), the variable V1 has its last significant bit forced to 1, the other bits remain unchanged.

SYNTAX: Result=BIN_OR(V1,V2)

  • V1 = integer or real data.
  • V2 = integer or real data.

USE

  • The function BIN_OR() is used to force a bit to 1.

ERROR

  • If V1 or V2 are not correct expressions.

EXAMPLE

print bin_or(3,5)

print "Result = 7"

SEE ALSO

BIN_AND()

BIN_XOR()