-
-
Notifications
You must be signed in to change notification settings - Fork 46.6k
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
Added Continued fractions #6846
Added Continued fractions #6846
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cclauss Looks good -
Small changes
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
504a0fd
to
e18b2fe
Compare
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
>>> continued_fraction(1/Fraction("2.25")) | ||
[0, 2, 4] | ||
>>> continued_fraction(Fraction("415/93")) | ||
[4, 2, 6, 7] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs tests for 0 and for negative numbers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added tests for 0 and negative numbers in #8985
* updating DIRECTORY.md * added continued fractions * updating DIRECTORY.md * Update maths/continued_fraction.py Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com> * Update maths/continued_fraction.py Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com> --------- Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com> Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
Describe your change:
added a function to convert a rational number to continued fraction list
Checklist:
Fixes: #{$ISSUE_NO}
.