diff options
Diffstat (limited to 'libsolidity/ast/Types.cpp')
-rw-r--r-- | libsolidity/ast/Types.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp index 7dc6c4a6..6ecf509d 100644 --- a/libsolidity/ast/Types.cpp +++ b/libsolidity/ast/Types.cpp @@ -413,6 +413,22 @@ u256 IntegerType::literalValue(Literal const* _literal) const return u256(_literal->value()); } +bigint IntegerType::minValue() const +{ + if (isSigned()) + return -(bigint(1) << (m_bits - 1)); + else + return bigint(0); +} + +bigint IntegerType::maxValue() const +{ + if (isSigned()) + return (bigint(1) << (m_bits - 1)) - 1; + else + return (bigint(1) << m_bits) - 1; +} + TypePointer IntegerType::binaryOperatorResult(Token::Value _operator, TypePointer const& _other) const { if ( |