Merge pull request #6951 from ethereum/chriseth-patch-1

[DOC] Fix signextend example.
This commit is contained in:
chriseth 2019-06-17 18:31:29 +02:00 committed by GitHub
commit 4a4c146fdf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -416,7 +416,7 @@ Local Solidity variables are available for assignments, for example:
in a context where this is important:
``uint32 x = f(); assembly { x := and(x, 0xffffffff) /* now use x */ }``
To clean signed types, you can use the ``signextend`` opcode:
``assembly { signextend(<bit_width_of_x>, x) }``
``assembly { signextend(<num_bytes_of_x_minus_one>, x) }``
Labels
------