Skip to content

Commit

Permalink
[ruby/bigdecimal] Correctly computing loop iterations in
Browse files Browse the repository at this point in the history
  • Loading branch information
z2-2z authored and hsbt committed Dec 25, 2023
1 parent 6897732 commit 862dde5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ext/bigdecimal/bigdecimal.c
Original file line number Diff line number Diff line change
Expand Up @@ -7230,7 +7230,7 @@ VpSqrt(Real *y, Real *x)
y->MaxPrec = Min((size_t)n , y_prec);
f->MaxPrec = y->MaxPrec + 1;
n = (SIGNED_VALUE)(y_prec * BASE_FIG);
if (n < (SIGNED_VALUE)maxnr) n = (SIGNED_VALUE)maxnr;
if (n > (SIGNED_VALUE)maxnr) n = (SIGNED_VALUE)maxnr;

/*
* Perform: y_{n+1} = (y_n - x/y_n) / 2
Expand Down

0 comments on commit 862dde5

Please sign in to comment.