Skip to content

Commit

Permalink
removed rayToWad
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Harvey committed Dec 17, 2023
1 parent 5a5b7a3 commit f9c22d5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
4 changes: 0 additions & 4 deletions src/libraries/internal/Maths.sol
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@ library Maths {
}
}

function rayToWad(uint256 x) internal pure returns (uint256) {
return (x + 10**9 / 2) / 10**9;
}

/*************************/
/*** Integer Functions ***/
/*************************/
Expand Down
13 changes: 0 additions & 13 deletions tests/forge/unit/MathTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,6 @@ import 'src/libraries/internal/Maths.sol';

contract MathTest is DSTestPlus {

function testRayToWadRounded() external {
uint256 amount = 5_000.00076103507940381999999950 * 1e27;
assertEq(Maths.rayToWad(amount), 5_000.000761035079403820 * 1e18);

assertEq(Maths.rayToWad(4 * 1e27), 4 * 1e18);
assertEq(Maths.rayToWad(0.0000000000000000006 * 1e27), 1);
assertEq(Maths.rayToWad(0.0000000000000000004 * 1e27), 0);
}

function testZeroStaysZero() external {
assertEq(Maths.rayToWad(0), 0);
}

function testMultiplication() external {
uint256 debt = 10_000.44444444444443999 * 1e18;
uint256 inflator = 1.02132007 * 1e27;
Expand Down

0 comments on commit f9c22d5

Please sign in to comment.