Is 0.001 decimal converted to binary just 1?
Thats what I get when I type it into my calculator on my computer but when I do it from an online converter I get: "0.00000000010000011000100100110111"
Well, no. Because floating point representation is complex.
oh ok.
Integer conversion back and forth, however, is very easy.
So neither answer is correct? I'm only asking because I'm trying to convert this decimal into a binary and then hex.
Yeesh, yes the answer is very complex and not easy to answer whatsoever. There are several standards for different sizes of floating point numbers. Lookup IEEE 754
binary\[...2^3 2^2 2^1 2^0 . 2^{-1} 2^{-2} 2^{-3}...\] \[.5~.25~.125~.0626~...\]it will be some addition of those that add up to .001
.0625 that is :)
@qpHalcy0n ok I'll do that. @amistre64 Alright I guessed I would have to do something like that.
14/2 = 7 R0 7/2 = 3 R1 3/2 = 1 R1 1/2 = 0 R1 14 = 1110 hmm, i was trying to see if it was as simple as dividing off 2s but that doesnt seem plausible in any case, it should still amount to some set of the fracionals
I know when I tried solving this originally I multiplied by 2 and started to get the long answer I got above in quotes.
http://www.wolframalpha.com/input/?i=convert+.001+to+base+2 oy that gives me a headache
@qpHalcy0n I've looked up that information and it explains that the first bit is the sign bit (0), the next 8 numbers is the exponent field (00000000) and the fractional part is the remaining digits from 0-23 (100000110001001001101110). So when I multiplied .001 by 2 32-times I got the following: \[0.00000000010000011000100100110111\] now when I typed this into the converter they got : "01110101" for the exponent. This throws off my hexadecimal value by two excluding the zeros from my exponential field I got "83126E" which is wrong according to the converter "3A83126E". Do you know how they are getting the 3 and the A?
Join our real-time social learning platform and learn together with your friends!