-
-
Notifications
You must be signed in to change notification settings - Fork 2.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
Add fast inverse square root algorithm #647
Add fast inverse square root algorithm #647
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.
Looks good, thanks!
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.
Please make the changes to the comments as I suggested in the discussion.
I think this already exists in a different form - https://github.com/TheAlgorithms/Go/blob/6429dfdb87ad0b2ae462f42f5307b6c0bcaca5c4/math/binary/sqrt.go |
@tjgurwara99 there is some problem with the algorithm what you send. |
I was in a hurry so I didn't write a descriptive comment but I pointed out the other implementation not because I want you to remove your implementation but rather do it without Furthermore, if you look closely, it is almost identical to your function so if you move it (and name it appropriately, eg
|
So, I need to:
Am I right? |
Yes 😄
To be honest, even I didn't notice that you'd used |
Head branch was pushed to by a user without write access
Co-authored-by: Taj <[email protected]>
Co-authored-by: Taj <[email protected]>
Co-authored-by: Taj <[email protected]>
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.
Looks good, thanks!
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.
LGMT
* Add fast inverse square root algorithm * PR improvements see comments in TheAlgorithms/Go#647 * Update math/binary/fast_inverse_sqrt.go file docstring Co-authored-by: Taj <[email protected]> * Update math/binary/fast_inverse_sqrt.go function documentation Co-authored-by: Taj <[email protected]> * Fix function documentation grammar Co-authored-by: Taj <[email protected]> --------- Co-authored-by: Taj <[email protected]>
Almost identical to C implementation but with golang specific unsafe package
https://en.wikipedia.org/wiki/Fast_inverse_square_root