Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
more fuzzing
  • Loading branch information
Amxx committed Jan 17, 2024
commit e82cbf486d7dde2fb255abd2c33169b24f36204e
9 changes: 8 additions & 1 deletion test/utils/math/Math.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ contract MathTest is Test {
}

// INV
function testInv(uint256 seed) public {
function testInv1(uint256 seed) public {
uint256 p;
uint256 value;
uint256 inverse;
Expand All @@ -80,6 +80,13 @@ contract MathTest is Test {
assertEq(mulmod(value, inverse, p), 1);
}

function testInv2(uint256 value, uint256 p) public {
uint256 inverse = Math.inv(value, p);
if (inverse != 0) {
assertEq(mulmod(value, inverse, p), 1);
}
}

// LOG2
function testLog2(uint256 input, uint8 r) public {
Math.Rounding rounding = _asRounding(r);
Expand Down