Add bitwise operators to the language to operate on Numeric types.
& bit-wise AND
| bit-wise OR
^ bit-wise XOR
~ bit-wise NOT
<< Left shift
>> Sign-propagating right shift
>>> Zero-fill right shift
These operations only work on Numeric types. If an operand is of a different type, NAN will be returned. Internally, the numbers are converted to Int64 before the operation happens.
For example, 5.5 will be converted to 5 beforehand.
Add bitwise operators to the language to operate on Numeric types.
&
bit-wise AND|
bit-wise OR^
bit-wise XOR~
bit-wise NOT<<
Left shift>>
Sign-propagating right shift>>>
Zero-fill right shiftThese operations only work on Numeric types. If an operand is of a different type,
NAN
will be returned. Internally, the numbers are converted toInt64
before the operation happens.For example,
5.5
will be converted to5
beforehand.