Skip to content

Move internal docs for fractions module to InternalDocs/fractions.md - #162475

Merged
StanFromIreland merged 12 commits into
python:mainfrom
skirpichev:move-fractions-internal-docs
Dec 3, 2026
Merged

StanFromIreland merged 12 commits into
python:mainfrom
skirpichev:move-fractions-internal-docs

Conversation

@skirpichev

Copy link
Copy Markdown
Member

This covers algorithms for addition/subtraction/multiplication.

This covers algorithms for addition/subtraction/multiplication.
@skirpichev

Copy link
Copy Markdown
Member Author

Rendered version:
https://github.com/skirpichev/cpython/blob/move-fractions-internal-docs/InternalDocs/fractions.md#algorithms-for-rational-arithmetics

This is a follow-up to #95723: proof of correctness, but this time - for arithmetics. I'm not sure if it worth: github-powered rendering of math is horrible. Though, maybe it will be improved someday.

Few questions:

  1. where we should put new section (first or last, as I did)?
  2. should we align notation with algorithm implementation? (two-letters symbols, like in code, looks ugly in latex)

Comment thread Lib/fractions.py Resolved
@StanFromIreland

Copy link
Copy Markdown
Member

CC @mdickinson

Comment thread InternalDocs/fractions.md Resolved
Comment thread InternalDocs/fractions.md Resolved
Comment thread InternalDocs/fractions.md Resolved
Comment thread InternalDocs/fractions.md Resolved
Comment thread InternalDocs/fractions.md Resolved
Comment thread InternalDocs/fractions.md Resolved
Comment thread InternalDocs/fractions.md Resolved
Comment thread InternalDocs/fractions.md Resolved
Comment thread InternalDocs/fractions.md Resolved
Comment thread InternalDocs/fractions.md Resolved
@skirpichev skirpichev added the pending The issue will be closed if no feedback is provided label Nov 30, 2026

@StanFromIreland StanFromIreland left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this pending?

Comment thread InternalDocs/fractions.md Resolved
Comment thread InternalDocs/fractions.md Resolved
Comment thread InternalDocs/fractions.md Resolved
Comment thread InternalDocs/fractions.md Resolved
@skirpichev skirpichev removed the pending The issue will be closed if no feedback is provided label Nov 30, 2026

@skirpichev skirpichev left a comment •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this pending?

I'm trying to reduce number of my opened prs. So, I put pending label after some time of no-activity. And close them after +1-1.5 months.

Edit: closed prs are still linked to open issues, may be reviewed and reviewers may ask to reopen them.

Comment thread Lib/fractions.py Resolved
Comment thread Lib/fractions.py Resolved
Comment thread InternalDocs/fractions.md Resolved
Co-authored-by: Stan Ulbrych <stan@python.org>
Comment thread InternalDocs/fractions.md Outdated

## Multiplication

Let $g = \gcd(a, d)$ and $h = \gcd\left(b, c\right)$, then\

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All this formatting is a little awkward, I don't think we need \left or \right, we also don't need the trailing \.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing '' is intentional, to write some math expressions as blocks. Here is what happens if I drop first two:
Screenshot From 2026-12-03 00-48-12

Note that some cases for math blocks ($$) displayed inline in Mark's text because of that.

\left and \right, probably, are useless. I put them to display nested parentheses better, but it has no effect. As I said, github math looks horrible.

@StanFromIreland
StanFromIreland merged commit 8dc1ea9 into python:main Dec 3, 2026
54 checks passed
@skirpichev
skirpichev deleted the move-fractions-internal-docs branch December 3, 2026 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants