mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
28 lines
991 B
Solidity
28 lines
991 B
Solidity
|
contract C {
|
||
|
function f(int x, uint y) public returns (int) {
|
||
|
return x**y;
|
||
|
}
|
||
|
}
|
||
|
// ====
|
||
|
// compileViaYul: also
|
||
|
// ----
|
||
|
// f(int256,uint256): 0, 0 -> 1
|
||
|
// f(int256,uint256): 0, 1 -> 0x00
|
||
|
// f(int256,uint256): 0, 2 -> 0x00
|
||
|
// f(int256,uint256): 1, 0 -> 1
|
||
|
// f(int256,uint256): 1, 1 -> 1
|
||
|
// f(int256,uint256): 1, 2 -> 1
|
||
|
// f(int256,uint256): 2, 0 -> 1
|
||
|
// f(int256,uint256): 2, 1 -> 2
|
||
|
// f(int256,uint256): 2, 2 -> 4
|
||
|
// f(int256,uint256): 7, 63 -> 174251498233690814305510551794710260107945042018748343
|
||
|
// f(int256,uint256): 128, 2 -> 0x4000
|
||
|
// f(int256,uint256): -1, 0 -> 1
|
||
|
// f(int256,uint256): -1, 1 -> -1
|
||
|
// f(int256,uint256): -1, 2 -> 1
|
||
|
// f(int256,uint256): -2, 0 -> 1
|
||
|
// f(int256,uint256): -2, 1 -> -2
|
||
|
// f(int256,uint256): -2, 2 -> 4
|
||
|
// f(int256,uint256): -7, 63 -> -174251498233690814305510551794710260107945042018748343
|
||
|
// f(int256,uint256): -128, 2 -> 0x4000
|
||
|
// f(int256,uint256): -1, 115792089237316195423570985008687907853269984665640564039457584007913129639935 -> -1
|