Skip to content

fix: preserve integer precision in trailing zeroes - #15313

Open
dajiaohuang wants to merge 1 commit into
TheAlgorithms:masterfrom
dajiaohuang:fix/trailing-zeroes-integer-division
Open

fix: preserve integer precision in trailing zeroes#15313
dajiaohuang wants to merge 1 commit into
TheAlgorithms:masterfrom
dajiaohuang:fix/trailing-zeroes-integer-division

Conversation

@dajiaohuang

Copy link
Copy Markdown

Describe your change

  • Fix a bug or typo in an existing algorithm?
  • Add an algorithm?
  • Add or change doctests? -- Note: Please avoid changing both code and tests in the same pull request.
  • Documentation change?

Checklist

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All function parameters and return values are annotated with Python type hints.
  • All functions have doctests that pass the automated testing.

Details

Use integer division while removing trailing digits so large integer inputs retain their precision and the function continues returning an integer count. Part of #15187.

Validation

  • uv run pytest maths/trailing_zeroes.py --doctest-modules -q
  • uv run ruff check maths/trailing_zeroes.py
  • uv run --with ty ty check maths/trailing_zeroes.py --output-format=concise
  • uvx pre-commit run --files maths/trailing_zeroes.py

@algorithms-keeper algorithms-keeper Bot added awaiting reviews This PR is ready to be reviewed enhancement This PR modified some existing files labels Sep 13, 2026
@cclauss

cclauss commented Sep 13, 2026

Copy link
Copy Markdown
Member

ON HOLD: Our focus is on merging or closing old pull requests before October 1st.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting reviews This PR is ready to be reviewed enhancement This PR modified some existing files on hold

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants