2020-03-09 21:14:07 +00:00
|
|
|
contract C {
|
|
|
|
function div(uint256 a, uint256 b) public returns (uint256) {
|
|
|
|
return a / b;
|
|
|
|
}
|
|
|
|
|
|
|
|
function mod(uint256 a, uint256 b) public returns (uint256) {
|
|
|
|
return a % b;
|
|
|
|
}
|
|
|
|
}
|
2020-04-17 20:24:33 +00:00
|
|
|
// ====
|
|
|
|
// compileViaYul: also
|
2020-11-21 13:54:16 +00:00
|
|
|
// compileToEwasm: also
|
2020-03-09 21:14:07 +00:00
|
|
|
// ----
|
|
|
|
// div(uint256,uint256): 7, 2 -> 3
|
2020-10-13 11:28:39 +00:00
|
|
|
// div(uint256,uint256): 7, 0 -> FAILURE, hex"4e487b71", 0x12 # throws #
|
2020-03-09 21:14:07 +00:00
|
|
|
// mod(uint256,uint256): 7, 2 -> 1
|
2020-10-13 11:28:39 +00:00
|
|
|
// mod(uint256,uint256): 7, 0 -> FAILURE, hex"4e487b71", 0x12 # throws #
|