mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
Changed the comparison of double values
This commit is contained in:
@ -174,7 +174,7 @@ namespace NSCSS
|
||||
|
||||
bool CDigit::Zero() const
|
||||
{
|
||||
return 0. == m_oValue;
|
||||
return (std::abs(m_oValue) <= DBL_EPSILON);
|
||||
}
|
||||
|
||||
void CDigit::Clear()
|
||||
@ -241,6 +241,16 @@ namespace NSCSS
|
||||
return m_enUnitMeasure;
|
||||
}
|
||||
|
||||
bool CDigit::operator==(const double &oValue) const
|
||||
{
|
||||
return (std::abs(oValue - m_oValue) <= DBL_EPSILON);
|
||||
}
|
||||
|
||||
bool CDigit::operator==(const CDigit &oDigit) const
|
||||
{
|
||||
return (std::abs(oDigit.m_oValue - m_oValue) <= DBL_EPSILON);
|
||||
}
|
||||
|
||||
CDigit CDigit::operator+(const CDigit &oDigit) const
|
||||
{
|
||||
CDigit oTemp;
|
||||
|
||||
@ -87,7 +87,7 @@ namespace NSCSS
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool operator==(const CValue& oValue) const
|
||||
bool operator==(const CValue& oValue) const
|
||||
{
|
||||
return m_oValue == oValue.m_oValue;
|
||||
}
|
||||
@ -141,6 +141,9 @@ namespace NSCSS
|
||||
|
||||
UnitMeasure GetUnitMeasure() const;
|
||||
|
||||
bool operator==(const double& oValue) const;
|
||||
bool operator==(const CDigit& oDigit) const;
|
||||
|
||||
CDigit operator+(const CDigit& oDigit) const;
|
||||
CDigit operator-(const CDigit& oDigit) const;
|
||||
CDigit operator*(const CDigit& oDigit) const;
|
||||
|
||||
Reference in New Issue
Block a user