Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.

Class template small_with_tolerance

boost::math::fpc::small_with_tolerance — Predicate for comparing floating point numbers against 0.


// In header: <boost/test/tools/floating_point_comparison.hpp>

template<typename FPT> 
class small_with_tolerance {
  // types
  typedef bool result_type;

  // construct/copy/destruct
  explicit small_with_tolerance(FPT);

  // public member functions
  bool operator()(FPT) const;


Serves the same purpose as boost::math::fpc::close_at_tolerance, but used when one of the operand is null.

small_with_tolerance public construct/copy/destruct

  1. explicit small_with_tolerance(FPT tolerance);

small_with_tolerance public member functions

  1. bool operator()(FPT fpv) const;