Skip to content

gh-75204: Clarify int division programming faq #129313

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

terryjreedy
Copy link
Member

@terryjreedy terryjreedy commented Jan 26, 2025

Explain the alternative choices for int division (i // j) and modulo (i % j) sign determination.
Mention that some languages choose truncation and 'i' determination. Justify Python's choice of flooring and 'j' determination.


📚 Documentation preview 📚: https://cpython-previews--129313.org.readthedocs.build/

Explain the alternative choices for int division (//)
and modulo (i % j) sign determination.
Mention that some languages choose truncation and 'i' determination.
Justify Python's choice of flooring and 'j' determination.
@terryjreedy terryjreedy added docs Documentation in the Doc dir skip news needs backport to 3.12 only security fixes needs backport to 3.13 bugs and security fixes labels Jan 26, 2025
@terryjreedy terryjreedy self-assigned this Jan 26, 2025
@encukou
Copy link
Member

encukou commented Jan 27, 2025

In the Reference section on // and %, there are a few footnotes with information of a similar nature. Did you consider linking from there to the FAQ entry?

@hugovk hugovk removed the needs backport to 3.12 only security fixes label Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting core review docs Documentation in the Doc dir needs backport to 3.13 bugs and security fixes skip news
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

3 participants