Fix exponentiation bug

This commit is contained in:
Harikrishnan Mulackal
2020-05-13 13:53:06 +05:30
parent cccf16ec35
commit 47e9a13e8a
4 changed files with 25 additions and 0 deletions
@@ -0,0 +1,10 @@
contract C {
function g() public pure {
int a;
a ** 1E1233;
a ** (1/2);
}
}
// ----
// TypeError: (67-78): Operator ** not compatible with types int256 and int_const 1000...(1226 digits omitted)...0000. Exponent too large.
// TypeError: (88-98): Operator ** not compatible with types int256 and rational_const 1 / 2. Exponent is fractional.
@@ -0,0 +1,7 @@
contract C {
function f() public pure {
uint a;
a = a ** 1E5;
a = 0 ** 1E1233;
}
}