Decimal fraction to Base 16 conversion problem
- 11 Comment
Recently a reader (Omar) left some comments on my post about base conversion involving a fraction. I will attempt to help him out in this post. This may clear up some problems for any other folks that may be having base conversion trouble.
“Convert the following number to from decimal to hexadecimal, stop at 4 decimal points
When dealing with floating point numbers or fractions, I find it best to use the multiplication method to figure out the conversion. The method outlined below will work for any conversion from a decimal fraction to another base. I will use Part a. as an example.
-First, multiply the original base 10 number (0.6640625) by the base you are trying to convert to.
0.6640625 * 16 = 10.62500
-”10″ is one digit in the base 16 conversion. However, we know there is no digit “10″ in base 16. We change this to “A” (0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F) Write down “A” for one of the base 16 digits.
-Next, take the remainder from the first product (0.62500) and multiply it by your goal base again.
0.62500 * 16 = 10
-It looks like “10″ is the other digit in the base 16 conversion. We know what to do with this. Write down “A” for the other base 16 digit.
-If we had another remainder we would keep going with the same pattern of (remainder * 16). However, the last remainder came out to an even “10″ or “A”.
-Now to represent the answer take the bottom hex digit and work your way back up to the first digit you converted and write it like so.
0.6640625 in Hexadecimal = 0.AA
That’s it! You can now convert from a fraction to any other base using the same method. Don’t forget to keep your decimal point when writing the final result. I will be helping Omar with some of his other problems in future posts. Happy Base Converting!
No related posts.
Related posts brought to you by Yet Another Related Posts Plugin.