034的二進制是多少?
乘以2,取進位:
0.34×2=0.68,進0
---------------------
0.68×2=1.36,進1
0.36×2=0.72,進0
0.72×2=1.44,進1,
0.44×2=0.88,進0,
0.88×2=1.76,進1,
0.76×2=1.52,進1,
0.52×2=1.04,進1
0.04×2=0.08,進0
0.08×2=0.16,進0
0.16×2=0.32,進0
0.32×2=0.64,進0
0.64×2=1.28,進1
0.28×2=0.56,進0
0.56×2=1.12,進1
0.12×2=0.24,進0
0.24×2=0.48,進0
0.48×2=0.96,進0
0.96×2=1.92,進1
0.92×2=1.84,進1
0.84×2=1.68,進1
0.68×2=1.36,進1,開始另一個循環(huán):
0.34的二進制為0.0101,0111,0000,1010,11...
也可以化成1/2^n的和:
0.34=34/100
=25/100+9/100
=1/4+36/400
=1/4+25/400+11/400
=1/4+1/16+44/1600
=1/4+1/16+25/1600+19/1600
=1/4+1/16+1/64+19/1600
=1/4+1/16+1/64+38/3200
=1/4+1/16+1/64+25/3200+13/3200
=1/4+1/16+1/64+1/128+13/3200
=1/4+1/16+1/64+1/128+26/6400
=1/4+1/16+1/64+1/128+25/6400+1/6400
=1/4+1/16+1/64+1/128+1/256+1/6400
=0.01010111...