Bumping manifests a=b2g-bump
[gecko.git] / mfbt / decimal / comparison-with-nan.patch
blob72afc9a679eebc84e0b1e0ee7b303824ee2ae246
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)
6 ++result;
8 return Decimal(resultSign, resultExponent, result);
11 bool Decimal::operator==(const Decimal& rhs) const
13 + if (isNaN() || rhs.isNaN())
14 + return false;
15 return m_data == rhs.m_data || compareTo(rhs).isZero();
18 bool Decimal::operator!=(const Decimal& rhs) const
20 + if (isNaN() || rhs.isNaN())
21 + return true;
22 if (m_data == rhs.m_data)
23 return false;
24 const Decimal result = compareTo(rhs);
25 if (result.isNaN())
26 return false;
27 return !result.isZero();
30 @@ -528,16 +532,18 @@ bool Decimal::operator<(const Decimal& r
31 const Decimal result = compareTo(rhs);
32 if (result.isNaN())
33 return false;
34 return !result.isZero() && result.isNegative();
37 bool Decimal::operator<=(const Decimal& rhs) const
39 + if (isNaN() || rhs.isNaN())
40 + return false;
41 if (m_data == rhs.m_data)
42 return true;
43 const Decimal result = compareTo(rhs);
44 if (result.isNaN())
45 return false;
46 return result.isZero() || result.isNegative();
49 @@ -546,16 +552,18 @@ bool Decimal::operator>(const Decimal& r
50 const Decimal result = compareTo(rhs);
51 if (result.isNaN())
52 return false;
53 return !result.isZero() && result.isPositive();
56 bool Decimal::operator>=(const Decimal& rhs) const
58 + if (isNaN() || rhs.isNaN())
59 + return false;
60 if (m_data == rhs.m_data)
61 return true;
62 const Decimal result = compareTo(rhs);
63 if (result.isNaN())
64 return false;
65 return result.isZero() || !result.isNegative();