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 pathbitNot.xml
More file actions
49 lines (49 loc) · 2.46 KB
/
Copy pathbitNot.xml
File metadata and controls
49 lines (49 loc) · 2.46 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
47
48
49
<doc>
<legacy_id>1262</legacy_id>
<name>bitNot</name>
<type>operator</type>
<syntax>
<example>bitNot <i>number</i></example>
</syntax>
<library></library>
<objects>
</objects>
<synonyms>
</synonyms>
<classification>
<category>Math, Logic, & Dates</category>
</classification>
<references>
<operator tag="not">not Operator</operator>
<function tag="baseConvert">baseConvert Function</function>
<operator tag="bitAnd">bitAnd Operator</operator>
<operator tag="bitOr">bitOr Operator</operator>
<operator tag="bitXor">bitXor 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 not" <glossary tag="operation">operation</glossary> on the unsigned, 32-bit <glossary tag="binary">binary</glossary> representation of a number.</summary>
<examples>
<example>bitNot 1 <code><i>-- evaluates to 4294967294</i></code></example>
<example>bitNot 14 <code><i>-- in binary: bitNot 0000000000001110; evaluates to 1111111111110001; converted to 4294967281</i></code></example>
</examples>
<description>
<p>Use the <b>bitNot</b> <glossary tag="operator">operator</glossary> to operate directly on the <glossary tag="bit">bits</glossary> of a number.</p><p/><p><b>Parameters:</b></p><p>The <i>number</i> is a number, or an <glossary tag="expression">expression</glossary> that <glossary tag="evaluate">evaluates</glossary> to a number, between zero and 4,294,967,295 (2^32 - 1).</p><p/><p><b>Comments:</b></p><p>To perform the <b>bitNot</b> <glossary tag="operation">operation</glossary>, LiveCode first converts the <glossary tag="operand">operand</glossary> to its <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 the <i>number</i>, LiveCode performs a <operator tag="not">not</operator> <glossary tag="operation">operation</glossary>. A <glossary tag="bit">bit</glossary> is 0 if the corresponding <glossary tag="bit">bit</glossary> of the <i>number</i> is 1, and 1 if the corresponding <glossary tag="bit">bit</glossary> of the <i>number</i> is 0.</p><p/><p>Finally, the binary number thus created is converted back to decimal.</p>
</description>
</doc>