Skip to content

Commit 129c055

Browse files
committed
docs
1 parent dd52a96 commit 129c055

3 files changed

Lines changed: 29 additions & 1 deletion

File tree

web/src/lib/tour/data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ let pages = [
77
},
88
{
99
title: "Basics",
10-
lessons: ["variables", "functions", "type-conversion", "classes"]
10+
lessons: ["variables", "functions", "type-conversion", "classes", "bitwise-ops"]
1111
},
1212
{
1313
title: "Types",
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
## Bitwise Operations
2+
Modu has support for the following bitwise operations:
3+
- `&` (AND)
4+
- `|` (OR)
5+
- `^` (XOR)
6+
- `<<` (left shift)
7+
- `>>` (right shift)
8+
- `~` (NOT)
9+
10+
[CODE]
11+
// bitwise AND operation
12+
print(12 & 10);
13+
14+
// bitwise OR operation
15+
print(12 | 10);
16+
17+
// bitwise XOR operation
18+
print(12 ^ 10);
19+
20+
// bitwise left shift operation
21+
print(12 << 2);
22+
23+
// bitwise right shift operation
24+
print(12 >> 2);
25+
26+
// bitwise NOT operation
27+
print(~12);

web/src/lib/tour/pages/contents.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- [Functions](functions)
99
- [Type Conversion](type-conversion)
1010
- [Classes](classes)
11+
- [Bitwise Operations](bitwise-ops)
1112

1213
### Types
1314
- [Integers](integers)

0 commit comments

Comments
 (0)