diff options
Diffstat (limited to 'mozglue/misc/decimal/Decimal.h')
-rw-r--r-- | mozglue/misc/decimal/Decimal.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mozglue/misc/decimal/Decimal.h b/mozglue/misc/decimal/Decimal.h index 4bb9a841e5..8d9adbff4f 100644 --- a/mozglue/misc/decimal/Decimal.h +++ b/mozglue/misc/decimal/Decimal.h @@ -234,11 +234,13 @@ public: // Note: fromString doesn't support "infinity" and "nan". static MFBT_API Decimal fromString(const std::string& aValue); static MFBT_API Decimal infinity(Sign); - static MFBT_API Decimal nan(); + static constexpr Decimal nan() { + return Decimal(EncodedData(Positive, EncodedData::ClassNaN)); + } static MFBT_API Decimal zero(Sign); // You should not use below methods. We expose them for unit testing. - MFBT_API explicit Decimal(const EncodedData&); + constexpr explicit Decimal(const EncodedData& data) : m_data(data) {} const EncodedData& value() const { return m_data; } private: |