numerical methods - Converting a repeating binary number to decimal (express as a series?) -


Repeats that looking at a binary number, for example 0. (0011) or 0.0 (101), how to Will it have to go about converting to decimals?

I have been able to dig so far, which is the simplest way to change a decimal binary number for decimal:

  res (N + 2) = res ( N + 1) / 2 + res (N)  

Where the resolution is the result of phase N, and N is running (n = 0; n -> (number binary digits) ). Often, applying a non-terminating binary number is a good approximation, for example

  dec: 0.4 || Bin: 0. (0110): 0/2 + 0 = 0 0/2 + 0 = 0 + 2 + 1 = 1 1/2/2 2 + 1 = 3/23/2 / 2 + 0 = 3 / 4 3/4/2 + 0 = 3/8 3/8/2 + 1 = 1 9/16 1/9/16/2 + 1 = 51/32 51/32/2 + 0 = 51/64 51 / 64/2 + 0 = 51/128 = 0.3984  

Which is approximately 0.4.

So, I have found an approximate calculation tool, but I am struggling with the search, one way to express it, I started trying to write it as a series On which I can count as n-> inf. = "Text">

One way to get an accurate answer is using an infinite geometric series. The infinite amount of powers of an excerpt, for the infinity of the Expendent 1, 0 & lt; = R

In your example, 0. (0011), 0.0011 degrees represents 3/16, take out 3 and you get R = 1/16 R / (1-R) ​​= (1 / 16) / (15/16) = 1/15 multiply that 3 is your conclusion and you get your answer: 3/15 = 1/5 = 0.2.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -