Add Sqrt and SqrtRound functions
That is yet another iteration to add `Sqrt` method for decimals. I've already seen previous attempts which were trying to reimplement the algorithm:
- https://github.com/shopspring/decimal/pull/111
- https://github.com/shopspring/decimal/pull/112
- https://github.com/shopspring/decimal/pull/130
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 is doing is just rescaling the integers to fit the desired precision.
合并状态:未合并 1 条评论