This repository was archived by the owner on Aug 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 223
Expand file tree
/
Copy pathbitOr.xml
More file actions
46 lines (46 loc) · 2.35 KB
/
Copy pathbitOr.xml
File metadata and controls
46 lines (46 loc) · 2.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<doc>
<legacy_id>1331</legacy_id>
<name>bitOr</name>
<type>operator</type>
<syntax>
<example><i>number1</i> bitOr <i>number2</i></example>
</syntax>
<library></library>
<objects>
</objects>
<synonyms>
</synonyms>
<classification>
<category>Math, Logic, & Dates</category>
</classification>
<references>
<operator tag="bitNot">bitNot Operator</operator>
<operator tag="or">or Operator</operator>
</references>
<history>
<introduced version="1.0">Added.</introduced>
</history>
<platforms>
<mac/>
<windows/>
<linux/>
<ios/>
<android/>
</platforms>
<classes>
<desktop/>
<server/>
<web/>
<mobile/>
</classes>
<security>
</security>
<summary>Performs a "bitwise or" <glossary tag="operation">operation</glossary> on the <glossary tag="binary">binary</glossary> representation of two numbers.</summary>
<examples>
<example>1 bitOr 0 <code><i>-- evaluates to 1</i></code></example>
<example>6 bitOr 2 <code><i>-- in binary: 110 bitOr 010; evaluates to 110; converted to 6</i></code></example>
</examples>
<description>
<p>Use the <b>bitOr</b> <glossary tag="operator">operator</glossary> to operate directly on the <glossary tag="bit">bits</glossary> of two numbers.</p><p/><p><b>Parameters:</b></p><p>The <i>number1</i> and <i>number2</i> are numbers, or <glossary tag="expression">expressions</glossary> that <glossary tag="evaluate">evaluate</glossary> to numbers, between zero and 4,294,967,295 (2^32 - 1).</p><p/><p><b>Comments:</b></p><p>To perform the <b>bitOr</b> <glossary tag="operation">operation</glossary>, LiveCode first converts both <glossary tag="operand">operands</glossary> to their <glossary tag="binary">binary</glossary> equivalent, a string of ones and zeroes. 1 is equivalent to true, and 0 is equivalent to false.</p><p/><p>For each bit of <i>number1</i>, LiveCode performs an <operator tag="or">or</operator> <glossary tag="operation">operation</glossary> with the corresponding <glossary tag="bit">bit</glossary> of <i>number2</i> to produce a result. A <glossary tag="bit">bit</glossary> is 0 if the corresponding <glossary tag="bit">bits</glossary> of <i>number1</i> and <i>number2</i> are both 0. Otherwise, the <glossary tag="bit">bit</glossary> is 1.</p><p/><p>Finally, the binary number thus created is converted back to decimal.</p>
</description>
</doc>