I have a binary number represented as 11.1111111 (the . being analogous to a decimal point). There are 2 bits before the point, and 1024 bits after the point. It was an exer
Each binary digit after the decimal point represents the decimal weight of 2^-n, starting with n=1.
This can be evaluated using any bignum library using Horner's method as: (this is just pseudocode)
power_of_five = 1;
digits = 0;
while digits_left
digits = digits * 10;
power_of_five = power_of_five * 5;
if (next_digit_is_set)
digits = digits + power_of_five;
end
This will result a 1024 digit bignum, out of which only the first 309 are significant.