I'm going to start with this famous quote from James Wilkinson's 1970 Turing Award Lecture, Some Comments from a Numerical Analyst.
In the early days of the computer revolution computer designers and
numerical analysts worked closely together and indeed were often the
same people. Now there is a regrettable tendency for numerical
analysts to opt out ...
There is more than one correct approach to convert the number. The former is a correct algorithm for the problem. This kind of base conversion would usually be implemented in a library for the programming language you are using. There might be many such implementations out there, and I don't know what all of them are doing.
I would not recommend the ...
(Disclaimer: Sorry this answer got a bit long, but I had the same problem and also didn't find an easy explanation on IEEE754 on the internet so I'm posting this. This is answering the question of the OP but also a bit more than that.)
I'll explain this with an example. If you consider these three numbers and their binary values:
0.06 = 0.000011110101110......
For example, C and C++ don’t adhere to it. They don’t define the details of floating point arithmetic. An implementation may adhere to that standard, and there is a standard way to inform the user about it.
I used one compiler with ieee compliant 32 and 64 bit floating point, and totally non-compliant 128 bit fp with roughly 105 bit mantissa.