mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
[DOC] Fix signextend example.
This commit is contained in:
parent
d774e30686
commit
b90d57a9fc
@ -416,7 +416,7 @@ Local Solidity variables are available for assignments, for example:
|
|||||||
in a context where this is important:
|
in a context where this is important:
|
||||||
``uint32 x = f(); assembly { x := and(x, 0xffffffff) /* now use x */ }``
|
``uint32 x = f(); assembly { x := and(x, 0xffffffff) /* now use x */ }``
|
||||||
To clean signed types, you can use the ``signextend`` opcode:
|
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
|
Labels
|
||||||
------
|
------
|
||||||
|
Loading…
Reference in New Issue
Block a user