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

Add Sqrt and SqrtRound functions #393

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

weirdgiraffe
Copy link

@weirdgiraffe weirdgiraffe commented Jan 8, 2025

That is yet another iteration to add Sqrt method into this package. I've already seen previous attempts which were trying to implement the algorithm:

so this solution doesn't reinvent the wheel and just uses the integer Sqrt provided by big go package. The only thing that this PR functionally adds is the rescaling of integers to fit the desired precision.

This PR just creates couple of aliases SqrtRound = PowWithPrecision(0.5, precision) and Sqrt = SrqrtRound(DivisionPrecision)

@weirdgiraffe
Copy link
Author

@mwoss I've seen that you've been involved into reviews of #130, so could you maybe take a look at this one as well?

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

Successfully merging this pull request may close these issues.

1 participant