Added Sqrt and SqrtRound functionality#130
Added Sqrt and SqrtRound functionality#130ldcicconi wants to merge 2 commits intoshopspring:masterfrom
Conversation
|
I need decimal to be sqrt(), it's current missed, please merge the function |
|
The implementation overall looks good. If you can @ldcicconi, please rebase it so I can merge it to master and add unit tests for this implementation. If you don't have time I can do it and write unit tests for this implementation. |
|
@mwoss on it. |
|
@mwoss I added some unit tests and made a few other changes. Let me know what you think. note: the second test case in the |
|
Hmm, I'm not sure why this algorithm is failing on numbers in the range (0, 1). What method you have used for calculating sqrt? Can you point me to the paper or any article? |
|
Can we get this PR merged? The code looks good, only issue is a couple digit off, and it's way more than enough for most use cases. #222 decimal_test.go:2913: Square root of 0.002342 should be 0.0483942145302514, not 0.0483942145302509 (error: %!s()) thanks |
|
Fair few years on, is there an intention to merge this? |
Based this on #111 , but corrected an algorithmic bug.
Not sure why those other changes are showing up.