refs #197, unit test and preliminary fix for nullUnit comparison

This commit is contained in:
Klaus Basan
2014-03-27 01:16:14 +01:00
parent 5bdb8659ca
commit d4f1221665
2 changed files with 10 additions and 0 deletions

View File

@@ -36,6 +36,7 @@ namespace BlackMisc
template <class MU, class PQ> bool CPhysicalQuantity<MU, PQ>::operator ==(const CPhysicalQuantity<MU, PQ> &other) const
{
if (this == &other) return true;
if (this->isNull() && other.isNull()) return true; // preliminary fix
double diff = std::abs(this->m_value - other.value(this->m_unit));
return diff <= this->m_unit.getEpsilon();
}