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 1 of 8.
Rashmi said:
6 years ago
5.375.
5 --> 101.
0.375 * 2 = 0.75,
0.75 * 2 = 1.5,
0.5 * 2 = 1.0.
Consider, only the decimal part from top to bottom ( 0 1 1).
THEREFORE 5.375=101.011.
5 --> 101.
0.375 * 2 = 0.75,
0.75 * 2 = 1.5,
0.5 * 2 = 1.0.
Consider, only the decimal part from top to bottom ( 0 1 1).
THEREFORE 5.375=101.011.
(22)
Rakshanda said:
7 years ago
Thanks for the answer @Surya.
(3)
Ishu said:
9 years ago
5.375.
5 = 1(2^2) + 0(2^1) + 1(2^0).
0.375 = (0/(2^1)) + (1/(2^2)) + (1/(2^3)).
5 = 1(2^2) + 0(2^1) + 1(2^0).
0.375 = (0/(2^1)) + (1/(2^2)) + (1/(2^3)).
(2)
Saravana said:
1 decade ago
Why we multiply in 2?
(1)
Bandi koushik said:
1 decade ago
5.375
5 --> 101.
0.375 * 2 = 0.75.
0.75 * 2 = 1.5.
0.5 * 2 = 1.0.
Consider decimals from top to bottom (0 1 1).
THEREFORE, 5.375=101.011.
5 --> 101.
0.375 * 2 = 0.75.
0.75 * 2 = 1.5.
0.5 * 2 = 1.0.
Consider decimals from top to bottom (0 1 1).
THEREFORE, 5.375=101.011.
(1)
Ayantika said:
1 decade ago
5.375.
Here 5-> 101.
0.375*2 = 0.750 decimal part = 0.
(omit decimal part).
0.750*2 = 1.50 decimal part = 1.
(omit decimal part).
0.5*2 = 1.0 decimal part = 1.
So, the ans is 101.011 (011 from top to down).
Here 5-> 101.
0.375*2 = 0.750 decimal part = 0.
(omit decimal part).
0.750*2 = 1.50 decimal part = 1.
(omit decimal part).
0.5*2 = 1.0 decimal part = 1.
So, the ans is 101.011 (011 from top to down).
(1)
Krish said:
10 years ago
5.375.
5 --> 101.
0.375 * 2 = 0.75.
0.75 * 2 = 1.5.
0.5 * 2 = 1.0.
Sorry I can't understanding why you peoples are taking 0.5 instead of 1.5, we have to take 1.5?
5 --> 101.
0.375 * 2 = 0.75.
0.75 * 2 = 1.5.
0.5 * 2 = 1.0.
Sorry I can't understanding why you peoples are taking 0.5 instead of 1.5, we have to take 1.5?
(1)
Firdous Sadaf Mohd Ismail said:
1 decade ago
5.375
first convert 5 into binary as
(5/2)=quotient(2) and remainder (1)
(2/2)=quotient(1) and remainder (0)
(1/1)=quotient(1) and remainder (1)
therefore 5 = 101 (write remainder from bottom to top)
Now covert 0.375 into binary as
0.375 * 2 = 0 .75
0.75 * 2 = 1 .5
0.5 * 2 = 1 .0
(write remainder from top to bottom)
Therefore the answer is 5.375=101.011
first convert 5 into binary as
(5/2)=quotient(2) and remainder (1)
(2/2)=quotient(1) and remainder (0)
(1/1)=quotient(1) and remainder (1)
therefore 5 = 101 (write remainder from bottom to top)
Now covert 0.375 into binary as
0.375 * 2 = 0 .75
0.75 * 2 = 1 .5
0.5 * 2 = 1 .0
(write remainder from top to bottom)
Therefore the answer is 5.375=101.011
Meera said:
1 decade ago
5.375
5/2 remainder is 1
2/2 remainder is 0
1/2 remainder is 1
bottom up---> 101
.375 * 2= 0.75 number without decimal point is 0
.75 * 2= 1.5 number without decimal point is 1
.5*2 =1 number without decimal point is 1
After reaching 1 stop it .
now it is top down ----->011
Hence the answer is 101.011
5/2 remainder is 1
2/2 remainder is 0
1/2 remainder is 1
bottom up---> 101
.375 * 2= 0.75 number without decimal point is 0
.75 * 2= 1.5 number without decimal point is 1
.5*2 =1 number without decimal point is 1
After reaching 1 stop it .
now it is top down ----->011
Hence the answer is 101.011
Ankit said:
1 decade ago
5 is equivalent to 101. The main problem is relate with floating points values.
0.375*2
0.750*2=write the digit left to the decimal point i.e.=0
1.500*2=write the digit left to the decimal point i.e.=1
0.500*2=write the digit left to the decimal point i.e.=1
1.000
Now combine the binary values:
(5.375)base 10=(101.011)base 2
0.375*2
0.750*2=write the digit left to the decimal point i.e.=0
1.500*2=write the digit left to the decimal point i.e.=1
0.500*2=write the digit left to the decimal point i.e.=1
1.000
Now combine the binary values:
(5.375)base 10=(101.011)base 2
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers