IsZero


Overloaded template function to compare value with zero. It returns true if value is equal(or nearly equal) to zero. For complex object comparison takes place for all components and function return true only if all of them are zero(or close to zero).

You can find more information in comments below.

template<class TYPE>
constexpr bool IsZero(const TYPE a); // Check whether argument is zero
template<class TYPE>
constexpr bool IsZero(const TYPE a, const TYPE tolerance = Tolerance<TYPE>); // Check whether argument is zero. For float values. Uses absolute comparison
template<class TYPE>
bool IsZero(const TRect<TYPE> &r); // Return whether rect's Right is equal to its Left or Bottom is equal to its Top
template<class TYPE>
bool IsZero(const TRect<TYPE> &r, const TYPE tolerance = Tolerance<TYPE>); // Return whether rect's Right is equal to its Left or Bottom is equal to its Top
Namespace: ntl
Include: NTL/Core/Utils.h (For non-object argument)
NTL/Core/Rect.h (For TRect argument)