Skip to content
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

Reduce Precision of Fraction #14

Closed
MadsKirkFoged opened this issue Feb 21, 2022 · 2 comments
Closed

Reduce Precision of Fraction #14

MadsKirkFoged opened this issue Feb 21, 2022 · 2 comments

Comments

@MadsKirkFoged
Copy link
Contributor

I am looking into creating more math operations for this library however i am hitting a wall where if I do too many calculation on a Fraction its 'size' gets too large and slows down the calculation.
Many of the math operations will have a fixed Precision so it doesn't make much sense if the fraction can grow forever.

ex.
1071283/28187739 (decimal: 0.0380052830771563 )

Reduce precision so the largest BigInt is 4 -->
107/2815 (decimal: 0.038010657 )

I have looked into creating a method that does this but I cant seem to find a good way.
Do you have an idea for this?

@danm-de
Copy link
Owner

danm-de commented Feb 21, 2022 via email

@MadsKirkFoged
Copy link
Contributor Author

I found a way :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants