|  | Home | Libraries | People | FAQ | More | 
BOOST_WARN_SMALL(value, tolerance); BOOST_CHECK_SMALL(value, tolerance); BOOST_REQUIRE_SMALL(value, tolerance);
          These tools are used to check that supplied value is small enough. The
          "smallness" is defined by absolute value of the tolerance supplied
          as a second argument. Use these tools with caution. To compare to values
          on closeness it's preferable to use BOOST_<level>_CLOSE tools instead.
        
The first parameter is the value to check. The second parameter is the tolerance.
| ![[Note]](../../../../../../../doc/src/images/note.png) | Note | 
|---|---|
| 
            Note that to use these tools you need to include additional header  | 
| Code | 
|---|
| #define BOOST_TEST_MODULE example #include <boost/test/included/unit_test.hpp> #include <boost/test/floating_point_comparison.hpp> BOOST_AUTO_TEST_CASE( test ) { double v = -1.23456e-3; BOOST_CHECK_SMALL( v, 0.000001 ); } | 
| Output | 
|---|
| > example Running 1 test case... test.cpp(11): error in "test": absolute value of v{-0.00123456} exceeds 1e-006 *** 1 failures is detected in test suite "example" | 
See also: