Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@shcabin
Copy link
Contributor

@shcabin shcabin commented Oct 10, 2025

PR Details

Use fundamental recursion formulas to avoid duplicate calculations.

Formula reference: https://en.wikipedia.org/wiki/Continued_fraction#Fundamental_recurrence_formulas, https://oi-wiki.org/math/number-theory/continued-fraction/#%E9%80%92%E6%8E%A8%E5%85%B3%E7%B3%BB

Description

Related Issue

Motivation and Context

benchmark:
old:
BenchmarkNumFmtPlaceHolder-12 410 2789684 ns/op 2068222 B/op 75930 allocs/op
new:
BenchmarkNumFmtPlaceHolder-12 47521 26230 ns/op 11782 B/op 374 allocs/op

How Has This Been Tested

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@shcabin shcabin changed the title Optimize/numfmt optimize: convert using continued fractions fundamental recurrence formulas Oct 10, 2025
@codecov
Copy link

codecov bot commented Oct 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.34%. Comparing base (d97f1a3) to head (1896979).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2220   +/-   ##
=======================================
  Coverage   99.34%   99.34%           
=======================================
  Files          32       32           
  Lines       25614    25616    +2     
=======================================
+ Hits        25447    25449    +2     
  Misses         89       89           
  Partials       78       78           
Flag Coverage Δ
unittests 99.34% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@xuri xuri added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 13, 2025
@shcabin shcabin marked this pull request as ready for review November 9, 2025 16:30
Copy link
Member

@xuri xuri left a comment

Choose a reason for hiding this comment

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

Thanks for your PR. I've left some comments.

Copy link
Member

@xuri xuri left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for your contribution.

@xuri xuri merged commit 3d23585 into qax-os:master Nov 10, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants