Allow exponentials with signed base and unsigned power.

This commit is contained in:
krk
2019-09-04 17:32:47 +02:00
committed by chriseth
parent c499758cd8
commit 33f7f960cf
10 changed files with 72 additions and 18 deletions
+4
View File
@@ -29,6 +29,10 @@ Semantic and Syntactic Changes
This section highlights changes that affect syntax and semantics.
* The resulting type of an exponentiation is the type of the base. It used to be the smallest type
that can hold both the type of the base and the type of the exponent, as with symmentric
operations. Additionally, signed types are allowed for the base of the exponetation.
How to update your code
=======================
+3 -2
View File
@@ -123,8 +123,9 @@ results in the same sign as its left operand (or zero) and ``a % n == -(abs(a) %
Exponentiation
^^^^^^^^^^^^^^
Exponentiation is only available for unsigned types. Please take care that the types
you are using are large enough to hold the result and prepare for potential wrapping behaviour.
Exponentiation is only available for unsigned types in the exponent. The resulting type
of an exponentiation is always equal to the type of the base. Please take care that it is
large enough to hold the result and prepare for potential wrapping behaviour.
.. note::
Note that ``0**0`` is defined by the EVM as ``1``.