Skip to content

Commit 462b528

Browse files
author
EricObermuhlner
committed
document BigDecimalMath.root(x, n) faster with large n
1 parent af79269 commit 462b528

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

docs/releases/next_release_note.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,14 @@ small negative rational toIntegerRationalString(): -1/2
6565
```
6666

6767

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

70+
The `BigDecimalMath.root(BigDecimal, BigDecimal, MathContext)` function converged very slowly for larger values of n.
71+
72+
This was due to a bad initial value for the Newton-Raphson approximation.
73+
74+
Now the initial value for the Newton-Raphson approximation is calculated using double precision.
75+
If the initial value cannot be calculated using double precision the function pow(x, 1/n) is used to calculate the root.
6976

7077

7178
# Enhancements

0 commit comments

Comments
 (0)