Skip to content

Commit

Permalink
fix: #21
Browse files Browse the repository at this point in the history
  • Loading branch information
xenide committed Jan 1, 2025
1 parent 0a21273 commit 83a4f2a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libraries/StableMath.sol
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ library StableMath {
uint256 D = s;
(xp0, xp1) = xp0 < xp1 ? (xp0, xp1) : (xp1, xp0);
for (uint256 i = 0; i < MAX_LOOP_LIMIT; i++) {
uint256 dP = ((D * D) / xp0).fullMulDiv(D, xp1) / 4;
uint256 dP = ((D * D) / xp0).fullMulDiv(D, xp1) >> 2;
prevD = D;
D = ((N_A * s) / A_PRECISION + 2 * dP).fullMulDiv(D, (N_A - A_PRECISION) * D / A_PRECISION + 3 * dP);
if (D.within1(prevD)) {
Expand Down

0 comments on commit 83a4f2a

Please sign in to comment.