
Recent Posts
Categories
 AltDevBlogADay
 Bugs
 Chromium
 Code analysis
 Code Reliability
 Commuting
 Computers and Internet
 Debugging
 Documentation
 Drinks
 Environment
 Floating Point
 Fractals
 Fun
 Gaming
 Investigative Reporting
 Linux
 Math
 memory
 Performance
 Programming
 Quadratic
 Rants
 Security
 Symbols
 Travel
 uiforetw
 Uncategorized
 Unicycling
 Visual Studio
 WLPG
 xperf
Follow me on Twitter
My TweetsMeta
Category Archives: Floating Point
C++ 11 std::async for Fast Float Format Finding
After a recent post on float precision there was some debate about roundtripping 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 float, precision, print, scanf
24 Comments
Float Precision–From Zero to 100+ Digits
How much precision does a float have? It depends on the float, and it depends on what you mean by precision. Typical reasonable answers range from 69 decimal digits, but it turns out that you can make a case for … Continue reading
Posted in AltDevBlogADay, Floating Point, Programming
Tagged double, float, floating point, floating point precision, precision, significant figures
52 Comments
Comparing Floating Point Numbers, 2012 Edition
This post is a more carefully thought out and peer reviewed version of a floatingpoint comparison article I wrote many years ago. This one gives solid advice and some surprising observations about the tricky subject of comparing floatingpoint numbers. A … Continue reading
Posted in AltDevBlogADay, Floating Point, Programming
Tagged comparing floats, double, epsilon, float, floating point precision, floating point tricks, precision
179 Comments
Don’t Store That in a Float
I promised in my last post to show an example of the importance of knowing how much precision a float has at a particular value. Here goes. As a general rule this type of data should never be stored in … Continue reading
Posted in AltDevBlogADay, Floating Point, Programming
Tagged double, float, floating point, game time, microseconds, precision, time resolution
27 Comments
They sure look equal…
This is a special bonus extra post in my floatingpoint series, ranting about an issue that has been a problem for years. Some debuggers don’t display floats with enough precision.
Posted in Floating Point, Math, Programming
Tagged debuggers, floating point, precision, visual studio, windbg
16 Comments
Stupid Float Tricks
Type Punning is Not a Joke I left the last post with a promise to share an interesting property of the IEEE float format. There are several equivalent ways of stating this property, and here are two of them.
Posted in AltDevBlogADay, Floating Point, Programming
Tagged floating point, integer representation, mantissa, negative zero
36 Comments
Tricks With the FloatingPoint Format
Years ago I wrote an article about how to do epsilon floatingpoint comparisons by using integer comparisons. That article has been quite popular (it is frequently cited, and the code samples have been used by a number of companies) and … Continue reading
Posted in AltDevBlogADay, Floating Point, Math, Programming
28 Comments