mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 00:16:51 +08:00
refs #197, unit test and preliminary fix for nullUnit comparison
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user