-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
Closed as not planned
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Description:
When performing a bitwise OR operation between two integers, the result is incorrect.
Specifically:
print(789 | 123) # Expected: 891, Actual: 895
print(bin(789 | 123)) # Outputs: 0b1101111111
Version:
Python 3.13.5 (installed globally on macOS 14.x, M1 architecture) although I seem to be getting the same issue on 3.11.6 which concerns me
The binary result 0b1101111111 corresponds to decimal 891, yet the interpreter returns 895.
This indicates a mismatch between the binary and decimal representations of the result.
Metadata
Metadata
Assignees
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error