for (int foo =10; foo>0; foo-- ) /* down count loop is shorter */ { wibble(); } for (int foo =10; foo>0; foo-- ) /* down count loop is shorter */ { wibble(); } for (int foo =0; foo<10; foo-- ) /* up count loop is longer */ { wibble(); } for (int foo =0; foo<10; foo-- ) /* up count loop is longer */ { wibble(); } int foo=10; if ( foo ) wibble() int foo=10; if ( foo ) wibble() int foo=10; if ( foo==0 ) wibble() int foo=10; if ( foo==0 ) wibble() Now do you see why zero might be false false?
Please note this is psuedo-code and no real instruction set looks quite like this. If you know assembly you know I'm simplifying things a lot here. If you know anything about compiler design, you didn't need to read this answer. Anyone who knows anything about loop unrolling or branch prediction, the advanced class is down the hall in room 203.Please note this is psuedo-code and no real instruction set looks quite like this. If you know assembly you know I'm simplifying things a lot here. If you know anything about compiler design, you didn't need to read this answer. Anyone who knows anything about loop unrolling or branch prediction, the advanced class is down the hall in room 203.