mirror of
https://github.com/ValKmjolnir/Nasal-Interpreter.git
synced 2026-05-02 19:00:47 +08:00
🚀 add bitwise operators or, xor, and
This commit is contained in:
13
README.md
13
README.md
@@ -221,6 +221,19 @@ Unary operators `-` `!` have the same function as C/C++.
|
||||
!0;
|
||||
```
|
||||
|
||||
Bitwise operators `~` `|` `&` `^` have the same function as C/C++.
|
||||
|
||||
```javascript
|
||||
# these operators will:
|
||||
# 1. convert f64 to i32 (static_cast<int32_t>)
|
||||
# 2. do the bitwise function
|
||||
|
||||
~0x80000000; # not 2147483647
|
||||
0x8|0x1; # or
|
||||
0x1&0x2; # and
|
||||
0x8^0x1; # xor
|
||||
```
|
||||
|
||||
Operators `=` `+=` `-=` `*=` `/=` `~=` are used in assignment expressions.
|
||||
|
||||
```javascript
|
||||
|
||||
Reference in New Issue
Block a user