Skip to content

Commit

Permalink
chore: space
Browse files Browse the repository at this point in the history
  • Loading branch information
MathisGD authored and MerlinEgalite committed Nov 8, 2023
1 parent 76ca930 commit a136b50
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/SpeedJumpIrm.sol
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ contract AdaptativeCurveIrm is IIrm {
// <=> endBorrowRate <= startBorrowRate.
avgBorrowRate = uint256((int256(endBorrowRate) - int256(startBorrowRate)).wDivDown(linearVariation));
}

return (avgBorrowRate, endRateAtTarget);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/libraries/MathLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ library MathLib {
int256 roundingAdjustment = (x < 0) ? -(LN2_INT / 2) : (LN2_INT / 2);
// Safe unchecked because x is bounded.
int256 q = (x + roundingAdjustment) / LN2_INT;
// Safe unchecked because |q * LN2_INT| <= |x|.
// Safe unchecked because |q * LN2_INT - x| <= LN2_INT/2.
int256 r = x - q * LN2_INT;

// Compute e^r with a 2nd-order Taylor polynomial.
// Safe unchecked because |r| < 1, expR < 2 and the sum is positive.
// Safe unchecked because |r| < 1e18, and the sum is positive.
uint256 expR = uint256(WAD_INT + r + (r * r) / WAD_INT / 2);

// Return e^x = 2^q * e^r.
Expand Down

0 comments on commit a136b50

Please sign in to comment.