From c01f5699e673f600fe87056b414996fef2224242 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Thu, 2 Feb 2017 00:16:50 +0000 Subject: [PATCH] Add isNegative to RationalNumberType --- libsolidity/ast/Types.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libsolidity/ast/Types.h b/libsolidity/ast/Types.h index 3917dca21..e280b32c2 100644 --- a/libsolidity/ast/Types.h +++ b/libsolidity/ast/Types.h @@ -411,6 +411,9 @@ public: /// @returns true if the value is not an integer. bool isFractional() const { return m_value.denominator() != 1; } + /// @returns true if the value is negative. + bool isNegative() const { return m_value < 0; } + private: rational m_value; };