-
Recent Posts
Categories
Meta
Category Archives: Floating Point
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”). I also supplied a test program that used C++ 11 threading to quickly prove this claim on … Continue reading
Posted in Floating Point
Tagged float, floating point, floating point precision, printf, scanf
8 Comments
Game Developer Magazine Floating Point
This is for references, code examples, and discussion regarding the floating-point article in the October 2012 Game Developer Magazine.
Doubles are not floats, so don’t compare them
I’ve seen a few online discussions linking to my Comparing Floating Point Numbers page for misguided reasons and I wanted to discuss those reasons to help people understand why throwing epsilons at the problem without understanding the situation is a … Continue reading
Posted in Floating Point, Programming
Tagged base conversion, epsilon, float, floating point, precision
8 Comments
Floating-Point Poetry
I gave a talk at iFest on Saturday that briefly covered some performance and precision issues taken from my series of floating-point blog posts. My talk was after Ed Fries, who did a brilliant talk on art and constraints, centered … Continue reading
That’s Not Normal–the Performance of Odd Floats
Denormals, NaNs, and infinities round out the set of standard floating-point values, and these important values can sometimes cause performance problems. The good news is, it’s getting better, and there are diagnostics you can use to watch for problems. In … Continue reading
Posted in AltDevBlogADay, Floating Point, Performance, Programming
Tagged denormal, floating point, infinity, NaN, special numbers, specials
6 Comments
Exceptional Floating Point
Floating-point math has an answer for everything, but sometimes that’s not what you want. Sometimes instead of getting an answer to the question sqrt(-1.0) (it’s NaN) it’s better to know that your software is asking imaginary questions. The IEEE standard … Continue reading
Posted in AltDevBlogADay, Floating Point, Programming
Tagged divide by zero, double, exceptions, float, floating point
13 Comments
Floating-point complexities
Binary floating-point math is complex and subtle. I’ve collected here a few of my favorite oddball facts about floating-point math, based on the articles so far in my floating-point series. The focus in this list is on float but the … Continue reading
Posted in AltDevBlogADay, Floating Point, Programming
Tagged comparing, denormal, digits, float, floating point, floating point precision, floating point tricks, precision, printing
8 Comments
Intermediate Floating-Point Precision
Riddle me this Batman: how much precision are these calculations evaluated at? If you answered ‘double’ and ‘float’ then you score one point for youthful idealism, but zero points for correctness. The correct answer, for zero-idealism points and forty two … Continue reading
Posted in AltDevBlogADay, Floating Point, Programming
Tagged double, float, floating point, floating point precision, intermediate precision, precision
34 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