diff options
author | chriseth <c@ethdev.com> | 2016-05-14 06:58:55 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2016-05-14 06:58:55 +0800 |
commit | 4b445b898e49c79f4f0ad80aa656ee33ca5b0ebc (patch) | |
tree | 78374c9e93450f5a55a62f7b00e08b58a58574a4 /docs/control-structures.rst | |
parent | 902f1458c61c20299d9d29480e2f73bd3125bb81 (diff) | |
parent | a927efb1513e31cfa9130458b4ea40d89e283b17 (diff) | |
download | dexon-solidity-4b445b898e49c79f4f0ad80aa656ee33ca5b0ebc.tar.gz dexon-solidity-4b445b898e49c79f4f0ad80aa656ee33ca5b0ebc.tar.zst dexon-solidity-4b445b898e49c79f4f0ad80aa656ee33ca5b0ebc.zip |
Merge pull request #546 from chriseth/fixiszero
Correctly use not/bnot/iszero.
Diffstat (limited to 'docs/control-structures.rst')
-rw-r--r-- | docs/control-structures.rst | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/control-structures.rst b/docs/control-structures.rst index b24909a6..249b00b0 100644 --- a/docs/control-structures.rst +++ b/docs/control-structures.rst @@ -265,7 +265,7 @@ idea is that assembly libraries will be used to enhance the language in such way // by using o_code = new bytes(size) o_code := mload(0x40) // new "memory end" including padding - mstore(0x40, add(o_code, and(add(add(size, 0x20), 0x1f), bnot(0x1f)))) + mstore(0x40, add(o_code, and(add(add(size, 0x20), 0x1f), not(0x1f)))) // store length in memory mstore(o_code, size) // actually retrieve the code, this needs assembly @@ -349,7 +349,7 @@ The opcodes `pushi` and `jumpdest` cannot be used directly. +-----------------------+------+---------------------------------------------------------------+ | exp(x, y) | | x to the power of y | +-----------------------+------+---------------------------------------------------------------+ -| bnot(x) | | ~x, every bit of x is negated | +| not(x) | | ~x, every bit of x is negated | +-----------------------+------+---------------------------------------------------------------+ | lt(x, y) | | 1 if x < y, 0 otherwise | +-----------------------+------+---------------------------------------------------------------+ @@ -361,7 +361,7 @@ The opcodes `pushi` and `jumpdest` cannot be used directly. +-----------------------+------+---------------------------------------------------------------+ | eq(x, y) | | 1 if x == y, 0 otherwise | +-----------------------+------+---------------------------------------------------------------+ -| not(x) | | 1 if x == 0, 0 otherwise | +| iszero(x) | | 1 if x == 0, 0 otherwise | +-----------------------+------+---------------------------------------------------------------+ | and(x, y) | | bitwise and of x and y | +-----------------------+------+---------------------------------------------------------------+ |