concept equalWithin in category f#

appears as: equalWithin
F# Deep Dives

This is an excerpt from Manning's book F# Deep Dives.

Let’s address that slight floating-point accuracy error. It’s common in this kind of coding to accept a degree of inaccuracy; and certainly in the actuarial domain, where so much else is approximated, an error in the 17th decimal place is acceptable. Using FsUnit and NUnit, it’s easy to change the test to accept a degree of approximation, using the equalWithin function: