Template Function ecl::isApprox

Function Documentation

template<typename Scalar, typename OtherScalar>
inline bool ecl::isApprox(const Scalar &x, const OtherScalar &y, typename numeric_limits<Scalar>::Precision precision = numeric_limits<Scalar>::dummy_precision)

Checks if two values are approximate.

Note that this does not use the usual direct epsilon bound check, instead, it uses the magnitudes of the values and supplied precision to determine the epsilon bounds before carrying out the operation.

Parameters:
  • x – - first input argument

  • y – - second input argument

  • precision – - precision to use (default is defined by the type).

Returns:

bool : true or false of the operation.