Skip to content

gh-75204: Clarify int division programming faq - #129313

Open
terryjreedy wants to merge 2 commits into
python:mainfrom
terryjreedy:whyfloor
Open

terryjreedy wants to merge 2 commits into
python:mainfrom
terryjreedy:whyfloor

Conversation

@terryjreedy

@terryjreedy terryjreedy commented Jan 26, 2025 •

Copy link
Copy Markdown
Member

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.
@encukou

encukou commented Jan 27, 2025

Copy link
Copy Markdown
Member

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
@serhiy-storchaka serhiy-storchaka added the needs backport to 3.14 bugs and security fixes label May 8, 2025
@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Apr 21, 2026
@AlexWaygood
AlexWaygood removed their request for review April 21, 2026 11:45
@github-actions github-actions Bot removed the stale Stale PR or inactive for long period of time. label May 14, 2026
@serhiy-storchaka serhiy-storchaka added the needs backport to 3.15 bugs and security fixes label May 30, 2026
@serhiy-storchaka
serhiy-storchaka requested a review from tim-one May 30, 2026 15:27
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

This PR is stale because it has been open for 90 days with no activity.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Sep 2, 2026
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 only security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes skip news stale Stale PR or inactive for long period of time.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

4 participants