Binary representation of real numbers
Real numbers :
Vulgar fraction with even denominator:
- Finite binary decimals = finite binary representation ( extension) of decimal numbers
All dyadic rational numbers = p/2n have a binary representation with a finite number n of binary digits after the radix point.
for example :
1/210=1/2110=0.12
1/410=1/2210=0.012
1/810=1/2310=0.0012
1/1610=1/2410=0.00012
1/3210=1/2510=0.000012
...
1/2n10= 0.00..12
For every positive integer n vulgar fraction 1/denominator with denominator with only powers of 2 as factors
will be represented by 0.00..12 with binary digit 1 on n-th place after the radix point.
1/810=0.0012
3/810=0.0112
7/810=0.1112
???? Equivalent conditions:
- denominator = p / 2 n
- every prime factor of denominator = 2
- Mixed recurring binary decimals
The binary expansion for a fraction with denominator = (2k)*q
with q odd consists of k digits followed by a repeating decimal with period n .
Period n is computed in the same way as in pure recurring binary decimals ( Vulgar fraction with odd denominator ).
1/610 = 1/ (2*3) 10= 0.0(01)...2
1/1010 = 1/(2*5)10 =0.0(0011)... 2
1/12 10= 1/(22*3)10=0.00(01)...2
1/1410 = 1/(2*7)10 =0.0(001)... 2
1/2010 = 1/( 22*5)10 =0.00(0011)...2
Vulgar fraction with odd denominator = other rational numbers
- Pure recurring binary decimals
have infinite binary representation ( not terminating ) with a finite sequence of binary digits repeating indefinitely.
1/310 = 1/(21+1)10 = 0.310 = 0.012= 12/112 period = 2
1/510 = 1/(22+1)10 = 0.210 = 0.00112= 12/112 period = 4
The binary expansion for a fraction with denominator 2^n - 1 is a repeating decimal with period n.
???? Equivalent conditions:
- denominator has only factors other then power of 2
- denominator mod 2 = 1
- gcd(denominator,2)=1
- denominator and 2 are relatively prime = coprime
- Odd(denominator) = true
- denominator = 2k+1, where k is an integer
length of digit sequence = period of external angle under doubling map = period of hyperbolic component =
Irrational numbers
have infinite decimal and binary expansions ( neither terminate nor recur ).
Underline digit : 0. 1 means digits repeating endlessly = 0.11111111111....
0.110 decimal digit = 1/10
0.12 binary digit = 1/ 2
Program which converts decimal fraction ( vulgar fraction) to binary form in Delphi with sources
Main page
Feel free to e-mail me!
Author: Adam Majewski adammaj1-at-o2-dot-pl
About
http://republika.pl/fraktal/