# Product with floating point [closed]

I was studying the product with floating point and I saw this example. I made the translation, sorry if something is not grammatically correct.

![enter image description here]

## closed as off-topic by Gilles♦Nov 7 '14 at 14:20

• This question does not appear to be about computer science within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

• The book is wrong. As you write, $2.5\times 12.125 = 30.3125$. – Yuval Filmus Nov 7 '14 at 1:06
• The problem is that with the outcome of the product x1*x2 that I put, I dont get to 30.3125. So I am doing something wrong too. – Richy Nov 7 '14 at 1:14
• Why not? $(11110.0101)_2 = (30.3125)_{10}$. – Yuval Filmus Nov 7 '14 at 1:15
• Don't use images as main content of your post. This makes your question impossible to search and inaccessible to the visually impaired; we don't like that. Please transcribe text and maths (note that you can use LaTeX) and don't forget to give proper attribution to your sources! – Raphael Nov 7 '14 at 8:35
• This question consists of scanned text and is thus unsearchable. It can be reopened if the text is posted as text. – Gilles Nov 7 '14 at 14:20

## 1 Answer

Here is the complete calculation: \begin{align*} &2.5 = (.101)_2 \times 2^2 \\ &12.125 = (.1100001)_2 \times 2^4 \\ &(.101)_2 \times 2^2 \cdot (.1100001)_2 \times 2^4 = (.0111100101)_2 \times 2^6 = (.111100101)_2 \times 2^5 \\ &(.111100101)_2 \times 2^5 = 30.3125 \end{align*} Ignore what the book says, and just make sure that you understand why this calculation works out.

Also, actual floating point formats usually omit the leading 1 in the mantissa, which is usually interpreted as the first digit before the dot rather than the first after the dot. Using this convention, the exponents add without correction (under your convention, you have to subtract 1, essentially since 1/2 times 1/2 equals 1/4 rather than 1/2).

• Just one more thing: 1100001 x 101 = 111100101. When i made the product I get this, but you get a zero before the first one. (0111100101) – Richy Nov 7 '14 at 2:33
• That's because I multiply numbers rather than strings of digits. My numbers have meaning. Try calculating $.1\times .1=.01$ – even though $1\times 1=1$, you get the extra zero. – Yuval Filmus Nov 7 '14 at 14:53