strod() and sprintf() inconsistency under GCC and MSVC
- by Dmitry Sapelnikov
I'm working on a cross-platform app for Windows and Mac OS X, and I have a problem with two standard C library functions: strtod() (string-to-double conversion) ? sprintf (when used for outputting double-precision floating point numbers) -- their GCC and MSVC versions return different results.
I'm looking for a well-tested cross-platform open-source implementation of those functions, or just for a pair of functions that would correctly and consistently convert double to string and back.
I've already tried the clib GCC implementation, but the code is too long and too dependent on other source files, so I expect the adaptation to be difficult.
What implementations of string-to-double and double-to-string functions would you recommend?