>The MESSAGEBOX() function parses the 2
N factors out of the various numbers passed to it to determine the various options. I need to accomplish this same sort of task. I should know this, but is there a formula or algorithm for parsing these factors out or does an iterative loop have to be used?
>
>Thanks,
>Bill
Question: Does the number 5 (binary 101) contain the binary factor 2^1 = 2?
Answer: bitand(5, 2) = 0; therefore, it does not.
And how about 6 (binary 110)?
Answer: bitand(5, 2) > 0, therefore, it does.
HTH,
Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)