3 ms·
That's the problem of java developers, they dont use the bitwise operations: if(e.intValue()%2 != 0) == >>> if((e.intValue()& 1) != 0)
by ichramm 16y ago
That's the problem of java developers, they dont use the bitwise operations:
if(e.intValue()%2 != 0) == >>> if((e.intValue()& 1) != 0)
- jankassens 16y agoThere's no problem here. You can be pretty sure simple calculations like this (and multiplications with a power of 2 vs. shifting etc.) will run the same machine code in the end.
- sfraser 16y agoI think you are right in this case - I updated my example code above to use bitwise and it is running in the same amount of time. (100,000 iterations in about 6 milliseconds)