Skip to content

Commit 686742c

Browse files
committed
Update bit* examples to use 0bxxxx integers
1 parent 48df1fd commit 686742c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

docs/language-definition.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -866,61 +866,61 @@ get({"name": "John", "age": 30}, "name") == "John"
866866
Returns the values resulting from the bitwise AND operation.
867867

868868
```expr
869-
bitand(10, 12) == 8
869+
bitand(0b1010, 0b1100) == 0b1000
870870
```
871871

872872
### bitor(int, int)
873873

874874
Returns the values resulting from the bitwise OR operation.
875875

876876
```expr
877-
bitor(10, 12) == 14
877+
bitor(0b1010, 0b1100) == 0b1110
878878
```
879879

880880
### bitxor(int, int)
881881

882882
Returns the values resulting from the bitwise XOR operation.
883883

884884
```expr
885-
bitxor(10, 12) == 6
885+
bitxor(0b1010, 0b1100) == 0b110
886886
```
887887

888888
### bitnand(int, int)
889889

890890
Returns the values resulting from the bitwise AND NOT operation.
891891

892892
```expr
893-
bitnand(10, 12) == 2
893+
bitnand(0b1010, 0b1100) == 0b10
894894
```
895895

896896
### bitnot(int)
897897

898898
Returns the values resulting from the bitwise NOT operation.
899899

900900
```expr
901-
bitnot(10) == -11
901+
bitnot(0b1010) == -0b1011
902902
```
903903

904904
### bitshl(int, int)
905905

906906
Returns the values resulting from the Left Shift operation.
907907

908908
```expr
909-
bitshl(45, 2) == 180
909+
bitshl(0b101101, 2) == 0b10110100
910910
```
911911

912912
### bitshr(int, int)
913913

914914
Returns the values resulting from the Right Shift operation.
915915

916916
```expr
917-
bitshr(45, 2) == 11
917+
bitshr(0b101101, 2) == 0b1011
918918
```
919919

920920
### bitushr(int, int)
921921

922922
Returns the values resulting from the unsigned Right Shift operation.
923923

924924
```expr
925-
bitushr(-5, 2) == 4611686018427387902
925+
bitushr(-0b101, 2) == 4611686018427387902
926926
```

0 commit comments

Comments
 (0)