tests: Add a fuzzy comparison macro

We use something like this in the matrix test suite, but it's useful for
other types.
tests: Use fuzzy float comparison where appropriate

This should make the test suite slightly more stable in the face of
fuzziness in the floating point operations.