Tag Archives: scanf

Float Precision Revisited: Nine Digit Float Portability

Last year I pointed out that float variables can be converted to text and then back to the same binary value using printf(“%1.8e”). You can also use %.9g for more compact results. I also supplied a test program that used … Continue reading

Posted in Floating Point | Tagged , , , , | 17 Comments

C++ 11 std::async for Fast Float Format Finding

After a recent post on float precision there was some debate about round-tripping of floats. My claim was that if you print a float with printf(ā€œ%1.8eā€, f); and then scan it back in then you are guaranteed to get back … Continue reading

Posted in Floating Point, Programming, Visual Studio | Tagged , , , | 24 Comments