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 5 of 8.
Sai said:
1 decade 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
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
Vishal said:
1 decade 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
Ajinkya said:
1 decade ago
For converting any Decimal Number to its equivalent Binary Number:
1) For the Integer part of the Number(Before Decimal Point):
Divide that Number by 2 (Eg. 5%2) till the quotient is 1 and note down the remainders in each division (either 0 or 1). When you reach 1, then stop and in the Remainder column, write 1 at the bottom. Then, for your integer part answer, write it from bottom to top.
2) For the Decimal part of the Number(After Decimal Point):
Multiply that Number by 2 (Eg. 0.375*2) till the answer reaches 1. But when you multiply by 2, remove the integer part of the answer and write it down in one column and then multiply the decimal part of the answer by 2 till you reach 1. And when you reach 1, then stop and your answer will be in the same order as that of the numbers that you had written in the column mentioned above.
Eg.) 5.375 : Ans.) 101.011
1) Firstly, integer part is : 5
So,
Remainder
5/2 = 1 (Bottom-Top Approach)
2/2 0
1 1
(As 1 is reached, STOP!!!)
Hence, Binary Equivalent of 5 = 101
2) Now for the Decimal Part: 0.375
Multiplication Answer
0.375*2 = 0.75 0 (Top-Bottom Approach)
0.75*2 = 1.50 1
0.50*2 = 1.00 1
(As 1 is reached, STOP!!!)
Hence, Binary Equivalent of 0.375 = 0.011
Therefore, Binary Equivalent of 5.375 = 101.011.
Hope this helps... :).
Keep Posting....
1) For the Integer part of the Number(Before Decimal Point):
Divide that Number by 2 (Eg. 5%2) till the quotient is 1 and note down the remainders in each division (either 0 or 1). When you reach 1, then stop and in the Remainder column, write 1 at the bottom. Then, for your integer part answer, write it from bottom to top.
2) For the Decimal part of the Number(After Decimal Point):
Multiply that Number by 2 (Eg. 0.375*2) till the answer reaches 1. But when you multiply by 2, remove the integer part of the answer and write it down in one column and then multiply the decimal part of the answer by 2 till you reach 1. And when you reach 1, then stop and your answer will be in the same order as that of the numbers that you had written in the column mentioned above.
Eg.) 5.375 : Ans.) 101.011
1) Firstly, integer part is : 5
So,
Remainder
5/2 = 1 (Bottom-Top Approach)
2/2 0
1 1
(As 1 is reached, STOP!!!)
Hence, Binary Equivalent of 5 = 101
2) Now for the Decimal Part: 0.375
Multiplication Answer
0.375*2 = 0.75 0 (Top-Bottom Approach)
0.75*2 = 1.50 1
0.50*2 = 1.00 1
(As 1 is reached, STOP!!!)
Hence, Binary Equivalent of 0.375 = 0.011
Therefore, Binary Equivalent of 5.375 = 101.011.
Hope this helps... :).
Keep Posting....
Jhunu said:
1 decade ago
Thanks narayan.
Shruthi kamath said:
1 decade ago
Thanks surya for clear explanation.
Yograj said:
1 decade ago
8421 8421 8421
0000 0000 0000
Simple logic to remember this:
Given 101.011
1st digit missing consider 421 i.e 101 (1-has value .0-nothing)
101.011
401.021
i.e
5.3(nearest answer).
0000 0000 0000
Simple logic to remember this:
Given 101.011
1st digit missing consider 421 i.e 101 (1-has value .0-nothing)
101.011
401.021
i.e
5.3(nearest answer).
Deepika said:
1 decade ago
8421
0101 - 5(4+1)
0011 - 3(2+1)
So 5.3 = 101.011
0101 - 5(4+1)
0011 - 3(2+1)
So 5.3 = 101.011
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers