C Programming - Floating Point Issues - Discussion
Discussion Forum : Floating Point Issues - General Questions (Q.No. 7)
7.
The binary equivalent of 5.375 is
Discussion:
76 comments Page 4 of 8.
Anil said:
1 decade ago
101.011->
101=5
For decimal part:
.011=.[0*{1/(2^1)} 2^1=2
+1*{1/(2^2)} 2^2=4
+1*{1/(2^3)}] 2^3=8
= .[0+1*0.25+1*0.125]
= .[0+0.25+0.125]
= 0.375
101=5
For decimal part:
.011=.[0*{1/(2^1)} 2^1=2
+1*{1/(2^2)} 2^2=4
+1*{1/(2^3)}] 2^3=8
= .[0+1*0.25+1*0.125]
= .[0+0.25+0.125]
= 0.375
Pramod said:
1 decade ago
Anil explanation is right way. Thanks dude.
Radha said:
1 decade ago
Thanks Narayana :-)
Mukti said:
1 decade ago
Thanks surya.
Shivanand said:
1 decade ago
Thanks yar anil.
Sasikumar said:
1 decade ago
5.375
1--001
2--010
3--011
4--100
5-- 101
0.375 * 2 = 0.750
0.75 * 2 = 1.500
0.5 * 2 = 1.000
Consider,only the decimal part from top to bottom ( 0 1 1)
THEREFORE, 5.375=101.011
1--001
2--010
3--011
4--100
5-- 101
0.375 * 2 = 0.750
0.75 * 2 = 1.500
0.5 * 2 = 1.000
Consider,only the decimal part from top to bottom ( 0 1 1)
THEREFORE, 5.375=101.011
Mohit said:
1 decade ago
If the size of integer is 4bytes, What will be the output of the program?
How we can examine this type of question?
How we can examine this type of question?
RENU said:
1 decade ago
5.375
5=101
0.375
*2
____________=0
0.750
*2
____________=1
1.500
0.500
*2
____________=1
so 5.375=101.011
that is B
5=101
0.375
*2
____________=0
0.750
*2
____________=1
1.500
0.500
*2
____________=1
so 5.375=101.011
that is B
Sibinxavier said:
1 decade ago
After "." it become
111= 1/2,1/4,1/8
375
011 = 0*(1/2)+1(1/4)+1(1/8)
=.25+.125 =.375
5.375 =101.011
111= 1/2,1/4,1/8
375
011 = 0*(1/2)+1(1/4)+1(1/8)
=.25+.125 =.375
5.375 =101.011
Subbu.B said:
1 decade ago
Thank you Surya and Susmita.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers