[DOC] Fix signextend example.

This commit is contained in:
chriseth 2019-06-17 13:39:20 +02:00 committed by GitHub
parent d774e30686
commit b90d57a9fc
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
------