1 diff --git a/mfbt/decimal/Decimal.cpp b/mfbt/decimal/Decimal.cpp
2 --- a/mfbt/decimal/Decimal.cpp
3 +++ b/mfbt/decimal/Decimal.cpp
4 @@ -505,21 +505,25 @@ Decimal Decimal::operator/(const Decimal
5 if (remainder > divisor / 2)
8 return Decimal(resultSign, resultExponent, result);
11 bool Decimal::operator==(const Decimal& rhs) const
13 + if (isNaN() || rhs.isNaN())
15 return m_data == rhs.m_data || compareTo(rhs).isZero();
18 bool Decimal::operator!=(const Decimal& rhs) const
20 + if (isNaN() || rhs.isNaN())
22 if (m_data == rhs.m_data)
24 const Decimal result = compareTo(rhs);
27 return !result.isZero();
30 @@ -528,16 +532,18 @@ bool Decimal::operator<(const Decimal& r
31 const Decimal result = compareTo(rhs);
34 return !result.isZero() && result.isNegative();
37 bool Decimal::operator<=(const Decimal& rhs) const
39 + if (isNaN() || rhs.isNaN())
41 if (m_data == rhs.m_data)
43 const Decimal result = compareTo(rhs);
46 return result.isZero() || result.isNegative();
49 @@ -546,16 +552,18 @@ bool Decimal::operator>(const Decimal& r
50 const Decimal result = compareTo(rhs);
53 return !result.isZero() && result.isPositive();
56 bool Decimal::operator>=(const Decimal& rhs) const
58 + if (isNaN() || rhs.isNaN())
60 if (m_data == rhs.m_data)
62 const Decimal result = compareTo(rhs);
65 return result.isZero() || !result.isNegative();