Skip to content

Commit

Permalink
document BigDecimalMath.root(x, n) faster with large n
Browse files Browse the repository at this point in the history
  • Loading branch information
EricObermuhlner committed Nov 6, 2022
1 parent af79269 commit 462b528
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/releases/next_release_note.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,14 @@ small negative rational toIntegerRationalString(): -1/2
```


## `BigDecimalMath.root(x, n)` faster with large n

The `BigDecimalMath.root(BigDecimal, BigDecimal, MathContext)` function converged very slowly for larger values of n.

This was due to a bad initial value for the Newton-Raphson approximation.

Now the initial value for the Newton-Raphson approximation is calculated using double precision.
If the initial value cannot be calculated using double precision the function pow(x, 1/n) is used to calculate the root.


# Enhancements
Expand Down

0 comments on commit 462b528

Please sign in to comment.