Hi,
Just curious.
I know there's a technical difference, but is there a significant speed difference between the use of MOD and AND? The rudimentary test below indicates a slight speed drop when using AND.
Code: T% = TIME
FOR I% = 0 TO &FFFFFF
A% = I% MOD &10000
NEXT
PRINT TIME - T%
T% = TIME
FOR I% = 0 TO &FFFFFF
B% = I% AND &FFFF
NEXT
PRINT TIME - T%
When using binary related figures, such as in the case above, is there a specific advantage to using AND rather than MOD? Many times in the illustation programs and code snipits from the various helps, I find that AND is used, where MOD might be used. Is this just common practice?
Matt