Template Function icrar::isApprox(const std::complex<T>&, const std::complex<T>&, T)

Function Documentation

template<typename T>
bool icrar::isApprox(const std::complex<T> &lhs, const std::complex<T> &rhs, T threshold)

returns true if the magnitude of the difference between two values are approximately equal (within the specified threshold)

Template Parameters:

T – input type

Parameters:
  • lhs – left value

  • rhs – right value

  • threshold – threshold where an equal absolute differance is considered as not approximately equal

Returns:

true if left value approximately equals right value

Returns:

false if left value does not approximately equals right value