solidity/test/libsolidity/semanticTests/arithmetics/addmod_mulmod.sol
Harikrishnan Mulackal e4e200f29f Changelog and tests
2020-05-11 15:29:05 +05:30

15 lines
403 B
Solidity

contract C {
function test() public returns (uint256) {
// Note that this only works because computation on literals is done using
// unbounded integers.
if ((2**255 + 2**255) % 7 != addmod(2**255, 2**255, 7)) return 1;
if ((2**255 + 2**255) % 7 != addmod(2**255, 2**255, 7)) return 2;
return 0;
}
}
// ====
// compileViaYul: also
// ----
// test() -> 0