On 4/20/06, Olin Lathrop wrote: > > YAP wrote: > > What is 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF (128 bits) in decimal? How > > go a head an calculate big numbers like this. > > Initialize a sum to 0 and a multiplier to 1. Start with the right most > HEX > digit and multiply it by the multiplier, then add it into the sum. For > each > successive digit to the left, increase the multiplier 16x, multiply the > digit by it, then add it into the sum. > > For example: > > Sum = 0, mult = 1, HEX digit = F. SUM <-- 0 + F*1 = 15 > Sum = 16, mult = 16, HEX digit = F. SUM <-- 15 + F*16 = 255 > Sum = 255, mult = 256, HEX digit = F. SUM <-- 255 + F*256 = 4095 > .. > Keep processing digits in right to left order until all digits exhausted. Thanks Olin et al. Appreciated. /Ake -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist