mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-04-29 12:16:14 -04:00
Update README.md
This commit is contained in:
parent
74b313da96
commit
ef51d31441
@ -148,7 +148,7 @@ def convert_to_hex(num: int) -> str:
|
|||||||
- `OR` and `AND`: symmetrical operations.
|
- `OR` and `AND`: symmetrical operations.
|
||||||
- `XOR`: when the corresponding bits of the two numbers are the same, the result is `1`.
|
- `XOR`: when the corresponding bits of the two numbers are the same, the result is `1`.
|
||||||
- negation is unary: just flips the bit.
|
- negation is unary: just flips the bit.
|
||||||
- left shift operation, `<<`, all binary bits are shift to the left (the high bits are discarded, and the low bits are filled with 0). for left shift operations, arithmetic shift and logical shift are the same.
|
- left shift operation, `<<`, all binary bits are shifted to the left (the high bits are discarded, and the low bits are filled with 0). for left shift operations, arithmetic shift and logical shift are the same.
|
||||||
- right shift operation, `>>`, all binary bits are shift to the right (low bits are discarded). how the high bits get filled differs between arithmetic shift and logical shift:
|
- right shift operation, `>>`, all binary bits are shift to the right (low bits are discarded). how the high bits get filled differs between arithmetic shift and logical shift:
|
||||||
- when shifting right arithmetically, the high bits are filled with the highest bit.
|
- when shifting right arithmetically, the high bits are filled with the highest bit.
|
||||||
- when shifting right logically, the high bits are filled with `0`.
|
- when shifting right logically, the high bits are filled with `0`.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user