2020-09-25 15:05:15 +00:00
|
|
|
pragma experimental ABIEncoderV2;
|
|
|
|
|
|
|
|
contract C {
|
|
|
|
function exp_neg_one(uint exponent) public returns(int) {
|
2020-09-15 14:16:30 +00:00
|
|
|
unchecked { return (-1)**exponent; }
|
2020-09-25 15:05:15 +00:00
|
|
|
}
|
|
|
|
function exp_two(uint exponent) public returns(uint) {
|
2020-09-15 14:16:30 +00:00
|
|
|
unchecked { return 2**exponent; }
|
2020-09-25 15:05:15 +00:00
|
|
|
}
|
|
|
|
function exp_zero(uint exponent) public returns(uint) {
|
2020-09-15 14:16:30 +00:00
|
|
|
unchecked { return 0**exponent; }
|
2020-09-25 15:05:15 +00:00
|
|
|
}
|
|
|
|
function exp_one(uint exponent) public returns(uint) {
|
2020-09-15 14:16:30 +00:00
|
|
|
unchecked { return 1**exponent; }
|
2020-09-25 15:05:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
// ====
|
|
|
|
// optimize: false
|
|
|
|
// optimize-yul: false
|
|
|
|
// ----
|
|
|
|
// creation:
|
|
|
|
// codeDepositCost: 119800
|
|
|
|
// executionCost: 165
|
|
|
|
// totalCost: 119965
|
|
|
|
// external:
|
|
|
|
// exp_neg_one(uint256): 2259
|
|
|
|
// exp_one(uint256): infinite
|
|
|
|
// exp_two(uint256): infinite
|
|
|
|
// exp_zero(uint256): infinite
|