diff options
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/ast/Types.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp index 343a7ea7..7558d715 100644 --- a/libsolidity/ast/Types.cpp +++ b/libsolidity/ast/Types.cpp @@ -703,14 +703,8 @@ TypePointer RationalNumberType::binaryOperatorResult(Token::Value _operator, Typ return TypePointer(); else if (fractional) { - value = m_value; - if (value > other.m_value) - { - do - { - value -= other.m_value; - } while (value > other.m_value); - } + rational tempValue = m_value / other.m_value; + value = m_value - (tempValue.numerator() / tempValue.denominator()) * other.m_value; } else value = m_value.numerator() % other.m_value.numerator(); |