Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The division-by-2 to use signed primitives means that the remainder can be 0<=x%y<2y instead of 0<=x%y<y. This change makes it behave the same way as the division operator, handling the two cases where the top bit (0x8000000000000000) is set separately and, if not, then adjusting the calculated remainder to ensure it's in range. This relies upon the fact that (x%2y)%y == (x%y).
- Loading branch information
Showing
1 changed file
with
25 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters