I wanted to have code for converting different floating point numbers to ASCII-text, which is independent of the CRT. There is code (fptoa.asm) by Tim Roberts, which is has been part of the MASM32 package for a long time, so i suppose it´s correct and bug free.

This code is written for real8 conversion, but i wanted to be able to convert real4, real10 and real16 too. All of these floating point type have different ranges and a different number of valid digits (digits of precision). So it would be nice to present as output only as much digits, as there are valid digits per format. That is, writing more than 6(7) digits for a real4 is pointless, because in a mathematical sense only 6 decimal places are always guaranteed to be valid, even if the conversion process may produce more digits to write.

For real8 the code is basically the same as proposed by Tim Roberts, i made adaptions for real4 and real10. It seems to work, but then i found a number causing problems when converted as a real4. I´m not absolutely sure, if the fix i found (change the floor value from 1.0e6 to 999999.1) doesn´t introduce other (rounding) problems.

I have no clue how to convert (losslessly) real16, because these don´t fit into the FPU registers.

There is also code for comparing conversion speed of these three routines:

- Real4_2_ASCII (by Siemanski)

- _StrToFloat (updated by me)

- _snprintf (CRT)

**Question:**

- is _StrToFloat working correctly, or are there still problems in code or the mathematical implementation?

- how could i do this (lossless) for real16 floating point numbers?

Thanks

JK