Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parsing Factors
Message
From
15/11/2002 14:33:16
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
15/11/2002 14:17:23
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00723361
Message ID:
00723370
Views:
7
>The MESSAGEBOX() function parses the 2N 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)
Previous
Reply
Map
View

Click here to load this message in the networking platform