1

When reading the Opcodes for the EVM article, I saw that the LT and SLT opcodes are evaluated to the same expression (a < b), as well as the GT and SGT opcodes (a > b).

How do LT and GT differ from SLT and SGT respectively?

1 Answer 1

1

The LT and GT opcodes work with the unsigned integers, while SLT and SGT - with the signed ones.

The difference consists in how they interpret the "sign bit":

  • in the case of signed integers, it's evaluated to a plus or a minus, while
  • in the case of the unsigned integers, it is interpreted as having a numerical value.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.