To get a binary value from a decimal value
v = val %2; -- v will contain the value of the ones digit. Then, after you get the digit, remove it to get the next digit:
v = val /2; Loop until val is 0.
Reputation Points: 3278
Solved Threads: 892
Posting Sage
Offline 7,718 posts
since May 2006