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*

2
  • You may want to clarify the first part of your answer: Bruce's article already explains why one should not use a constant epsilon (such as the ones defined in a header file) for tolerance comparison. Also, in many cases, an error of a few millions of ULPs is not something to worry about, because in most applications, we care more about the significant digits more than the errors in the least-significant digits, because double-precision already gives many more digits than we care about. Commented Aug 10, 2013 at 23:08
  • @rwong - as I read it, the question was to identify the correct term to use for a constant's name. So that's why I provided the float.h reference along with a few others to machine epsilon. The article from Dawson is something I found while searching for the IEEE 754 reference and I thought was relevant to the OP's simplest formula for comparison. Many use that approach as a first attempt, and I included Dawson's article because it really goes into the nuances of just how tricky the comparison is. So I tried to directly answer the question and then point out why not to use it that way. Commented Aug 11, 2013 at 13:40