Add isNegative to RationalNumberType

This commit is contained in:
Alex Beregszaszi 2017-02-02 00:16:50 +00:00
parent 5225a5bb5e
commit c01f5699e6

View File

@ -411,6 +411,9 @@ public:
/// @returns true if the value is not an integer. /// @returns true if the value is not an integer.
bool isFractional() const { return m_value.denominator() != 1; } bool isFractional() const { return m_value.denominator() != 1; }
/// @returns true if the value is negative.
bool isNegative() const { return m_value < 0; }
private: private:
rational m_value; rational m_value;
}; };