diff options
author | chriseth <chris@ethereum.org> | 2018-02-15 21:57:09 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-15 21:57:09 +0800 |
commit | f4aa05f308ef6b738e94e400b1cfcfb49b3bf5d6 (patch) | |
tree | eb5d78372cd7f849d7a6a2bc49cbb1280bf78ecc /docs/miscellaneous.rst | |
parent | 5746e2d7d867440780ced524dd7e7c29149cf3e2 (diff) | |
parent | 2b5a5a8669cee8698f3f2cf970417a7123fbbe25 (diff) | |
download | dexon-solidity-f4aa05f308ef6b738e94e400b1cfcfb49b3bf5d6.tar.gz dexon-solidity-f4aa05f308ef6b738e94e400b1cfcfb49b3bf5d6.tar.zst dexon-solidity-f4aa05f308ef6b738e94e400b1cfcfb49b3bf5d6.zip |
Merge pull request #3523 from ethereum/throwMulmod
Make addmod and mulmod revert if the last argument is zero.
Diffstat (limited to 'docs/miscellaneous.rst')
-rw-r--r-- | docs/miscellaneous.rst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/miscellaneous.rst b/docs/miscellaneous.rst index 1c4f918c..328ec6ea 100644 --- a/docs/miscellaneous.rst +++ b/docs/miscellaneous.rst @@ -327,8 +327,8 @@ Global Variables - ``sha256(...) returns (bytes32)``: compute the SHA-256 hash of the :ref:`(tightly packed) arguments <abi_packed_mode>` - ``ripemd160(...) returns (bytes20)``: compute the RIPEMD-160 hash of the :ref:`(tightly packed) arguments <abi_packed_mode>` - ``ecrecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) returns (address)``: recover address associated with the public key from elliptic curve signature, return zero on error -- ``addmod(uint x, uint y, uint k) returns (uint)``: compute ``(x + y) % k`` where the addition is performed with arbitrary precision and does not wrap around at ``2**256`` -- ``mulmod(uint x, uint y, uint k) returns (uint)``: compute ``(x * y) % k`` where the multiplication is performed with arbitrary precision and does not wrap around at ``2**256`` +- ``addmod(uint x, uint y, uint k) returns (uint)``: compute ``(x + y) % k`` where the addition is performed with arbitrary precision and does not wrap around at ``2**256``. Assert that ``k != 0`` starting from version 0.5.0. +- ``mulmod(uint x, uint y, uint k) returns (uint)``: compute ``(x * y) % k`` where the multiplication is performed with arbitrary precision and does not wrap around at ``2**256``. Assert that ``k != 0`` starting from version 0.5.0. - ``this`` (current contract's type): the current contract, explicitly convertible to ``address`` - ``super``: the contract one level higher in the inheritance hierarchy - ``selfdestruct(address recipient)``: destroy the current contract, sending its funds to the given address |