mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Allow exponentials with signed base and unsigned power.
This commit is contained in:
@@ -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
|
||||
=======================
|
||||
|
||||
@@ -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``.
|
||||
|
||||
Reference in New Issue
Block a user