Skip to content

Compare collections of floating point values with tolerance #173

Description

@Flamefire

Currently you can use either:

  • BOOST_TEST_REQUIRE( output == outputDesired, boost::test_tools::per_element() );
  • BOOST_TEST_REQUIRE( output == outputDesired, boost::test_tools::tolerance( 1e-12f ) );

But you cannot use both.

What is the preferred way to compare collections (e.g. vectors) of floating point values?

This is a common use case for testing numeric algorithms: Check results of optimized version vs. naive implementation.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions