devxlogo

And is faster the Mod

And is faster the Mod

Use the And operator instead of Mod when the divisor is a number in the form 2^N. For instance, there are two methods to extract the least significant byte in an Integer:

lowByte% = value% Mod 256lowByte% = value% And 255

The second one is slightly faster.

devx-admin

Share the Post: