Tag Archives: float

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 6-9 decimal digits, but it turns out that you can make a case for … Continue reading

Posted in AltDevBlogADay, Floating Point, Programming | Tagged , , , , , | 51 Comments

Comparing Floating Point Numbers, 2012 Edition

This post is a more carefully thought out and peer reviewed version of a floating-point comparison article I wrote many years ago. This one gives solid advice and some surprising observations about the tricky subject of comparing floating-point numbers. We’ve … Continue reading

Posted in AltDevBlogADay, Floating Point, Programming | Tagged , , , , , , | 220 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 , , , , , , | 27 Comments