6

uint8 x = 255;

x += 10;

Is x going to be 0 or 9?

8

x will be 9.

Use this code and How to quickly test a Solidity function?

contract C {
    function test() returns(uint) {
        uint8 x = 255;
        x += 10;
        return x;
    }
}

Decoded: uint256: 9

  • You're a life saver! Thank you, good sir! You're like a kind wizard that makes dumb contracts smart)) – manidos Jul 27 '16 at 8:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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