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
+1 -1
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
------