I'm given the number: $$8.881784197001252 \cdot 10^{-16}$$ I know it is $2^{-50}$ but suppose I didn't know. I need to convert it to binary.
One way is to apply the school taught algorithm on the fractional part. That'd be:
$.881784197001252\cdot2=1.763568394 \to 1$
$.763568394 \cdot 2=1.527136788 \to 1$
$.527136788 \cdot 2=1.054273576 \to 1$
$.054273576 \cdot 2= 0.108547152 \to 0$
$.108547152 \cdot 2=0.217094304 \to 0$
$...$
It may go on forever so I'd need to determine when to stop.
I then thought I could write the number as: $$8881784197001252 \cdot 10^{-31}$$ Now the number is an integer and I can precisely convert it. It's: $$11111100011011110111110001000000010001011000000100100$$ The problem is that I don't know how to convert the base and its exponent from base 10 to base 2. I can approximate it after some attempts. It should be between $2^{-100}$ and $2^{-99}$.
So what I'm asking is: what is the correct approach to convert that number? And, if different from the former, what method does the computer use?