You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: libscript/src/bitwise.mlc
+17-2Lines changed: 17 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
This module specifies the syntax definitions and bindings for bitwise operations on integers in modular LiveCode.
2
+
This module specifies the bitwise operations on integers included in the standard library of modular LiveCode.
3
3
*/
4
4
5
5
module com.livecode.bitwise
@@ -26,7 +26,9 @@ Example:
26
26
27
27
Description:
28
28
Each bit of <Left> bitwise and <Right> is 1 if and only if both the corresponding bit of the binary representation of <Left> and that of <Right> is 1. Otherwise it is 0.
29
-
29
+
30
+
Tags: Bitwise operations
31
+
30
32
*/
31
33
32
34
syntax BitwiseAnd is left binary operator with precedence 2
@@ -50,6 +52,7 @@ Example:
50
52
Description:
51
53
Each bit of <Left> bitwise or <Right> is 0 if and only if both the corresponding bit of the binary representation of <Left> and that of <Right> is 0. Otherwise it is 1.
52
54
55
+
Tags: Bitwise operations
53
56
*/
54
57
55
58
syntax BitwiseOr is left binary operator with precedence 4
@@ -72,6 +75,7 @@ Example:
72
75
Description:
73
76
Each bit of <Left> bitwise xor <Right> is 1 if and only if exactly one of the corresponding bits of the binary representation of <Left> and that of <Right> is 1. Otherwise it is 0.
74
77
78
+
Tags: Bitwise operations
75
79
*/
76
80
77
81
syntax BitwiseXor is left binary operator with precedence 3
@@ -85,6 +89,15 @@ Summary: Performs a bitwise NOT operation on the binary representation of
85
89
86
90
Operand: An expression which evaluates to an integer.
87
91
output: The integer whose binary representation is the result of the bitwise NOT operation.
92
+
93
+
Example:
94
+
variable tVar as int
95
+
put bitwise not -5 into tVar -- tVar contains 4
96
+
97
+
Description:
98
+
Bitwise not returns the complement of <Operand> as a signed 32-bit integer, thus is equivalent to -(x + 1).
99
+
100
+
Tags: Bitwise operations
88
101
*/
89
102
90
103
syntax BitwiseNot is prefix operator with precedence 1
@@ -108,6 +121,8 @@ Example:
108
121
109
122
Description:
110
123
Shifting the bits of <Operand> by x is equivalent to multiplying by 2^x
124
+
125
+
Tags: Bitwise operations
111
126
*/
112
127
113
128
syntax BitwiseShift is postfix operator with precedence 1
0 commit comments