Compare double in VBA precision problem

You can’t compare floating point values for equality. See this article on “Comparing floating point numbers” for a discussion of how to handle the intrinsic error.

It isn’t as simple as comparing to a constant error margin unless you know for sure what the absolute range of the floats is beforehand.

Leave a Comment