mirror of
https://github.com/MikeMcl/decimal.js.git
synced 2024-10-27 20:34:12 +00:00
Correct sqrt initial estimate
This commit is contained in:
parent
11699c1d1c
commit
e70384ea7e
@ -1728,7 +1728,7 @@
|
||||
e = mathfloor((e + 1) / 2) - (e < 0 || e % 2);
|
||||
|
||||
if (s == 1 / 0) {
|
||||
n = '1e' + e;
|
||||
n = '5e' + e;
|
||||
} else {
|
||||
n = s.toExponential();
|
||||
n = n.slice(0, n.indexOf('e') + 1) + e;
|
||||
|
@ -1724,7 +1724,7 @@ P.squareRoot = P.sqrt = function () {
|
||||
e = mathfloor((e + 1) / 2) - (e < 0 || e % 2);
|
||||
|
||||
if (s == 1 / 0) {
|
||||
n = '1e' + e;
|
||||
n = '5e' + e;
|
||||
} else {
|
||||
n = s.toExponential();
|
||||
n = n.slice(0, n.indexOf('e') + 1) + e;
|
||||
|
Loading…
Reference in New Issue
Block a user