Skip to content

Conversation

sterliakov
Copy link

While it can not cause any loss of precision for numbers under 2**53, and all the affected cases do not deal with numbers larger than 0xffffff, this is still a code smell (and is not obviously correct - using int(value / 4) instead of value // 4 can cause loss of precision for e.g. value = 2**63 - 1, resulting in a number off by one. Using floordiv with Python integers (which do not have limited bitwidth) avoids such questions entirely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant