bitOr | ||||||||||
Type | operator | |||||||||
Dictionary | LCS | |||||||||
Library | LiveCode Script | |||||||||
Syntax |
| |||||||||
Summary | Performs a "bitwise or" operation on the binary representation of two numbers. | |||||||||
Introduced | 1.0 | |||||||||
OS | mac, windows, linux, ios, android | |||||||||
Platforms | desktop, server, mobile | |||||||||
Parameters |
| |||||||||
Example |
| |||||||||
Related | Operator: or, bitNot Glossary: operation, operator, bit, binary, operand | |||||||||
Description | Use the bitOr operator to operate directly on the bits of two numbers. To perform the bitOr operation, LiveCode first converts both operands to their binary equivalent, a string of ones and zeroes. 1 is equivalent to true, and 0 is equivalent to false. For each bit of number1, LiveCode performs an or operation with the corresponding bit of number2 to produce a result. A bit is 0 if the corresponding bits of number1 and number2 are both 0. Otherwise, the bit is 1. Finally, the binary number thus created is converted back to decimal. | |||||||||
Tags | math |