This question already has an answer here:

Assume a contract:

contract A {

    function b() constant returns (uint8 result) {
      result =1;   

When I replace uint8 result with uint256 result then the creation of the contract gets 804 Gas cheaper:

uint8     47631  
uint256   46827 

How does this work?

marked as duplicate by Richard Horrocks, Bokky WeAreAllAssange PooBah, eth Jul 23 '16 at 22:19

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.