-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Open
Labels
area:class referenceIssues and PRs about the class reference, which should be addressed on the Godot engine repositoryIssues and PRs about the class reference, which should be addressed on the Godot engine repositorydiscussionenhancement
Description
Issue description:
-1/2 does not equal to -1 >> 1
Documentation for operator>> says: "Effectively the same as dividing by a power of 2".
This is only true when the integer is non-negative.
When shifted right, the new bits will have the value of the (previously) most significant bit.
Example:
0xF000_0000_0000_0000 >> 12 is 0xFFFF_0000_0000_0000
0x0F00_0000_0000_0000 >> 12 is 0x0000_F000_0000_0000
Negative numbers will converge to -1, and other numbers will converge to 0.
URL to the documentation page (if already existing):
https://docs.godotengine.org/en/stable/classes/class_int.html#class-int-operator-bwsr-int
Metadata
Metadata
Assignees
Labels
area:class referenceIssues and PRs about the class reference, which should be addressed on the Godot engine repositoryIssues and PRs about the class reference, which should be addressed on the Godot engine repositorydiscussionenhancement