Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 5
    See this SO question: Rounding Errors? Commented Sep 16, 2010 at 19:31
  • 111
    Just to be clear, they shouldn't be used for anything that requires accuracy -- not just currency. Commented Sep 16, 2010 at 19:59
  • 204
    They shouldn't be used for anything that requires exactness. But double's 53 significant bits (~16 decimal digits) are usually good enough for things that merely require accuracy. Commented Sep 17, 2010 at 19:23
  • 40
    @jeff Your comment completely misrepresents what binary floating-point is good for and what it isn't good for. Read the answer by zneak below, and please delete your misleading comment. Commented Aug 3, 2014 at 21:08
  • 3
    And to be clear, by "exactness" (or "precision") you mean in decimal. Commented Aug 20, 2021 at 16:38