From afc56db6d584dca4efe6627b44d82c4430b06948 Mon Sep 17 00:00:00 2001 From: chriseth Date: Mon, 21 Mar 2022 11:23:48 +0100 Subject: [PATCH] Simplify tostring. --- libsolutil/BooleanLP.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libsolutil/BooleanLP.cpp b/libsolutil/BooleanLP.cpp index 277091147..d1cb0e524 100644 --- a/libsolutil/BooleanLP.cpp +++ b/libsolutil/BooleanLP.cpp @@ -58,7 +58,11 @@ void resizeAndSet(vector& _vector, size_t _index, T _value) string toString(rational const& _x) { - if (_x.denominator() == 1) + if (_x == u256(1) << 256) + return "2**256"; + else if (_x == (u256(1) << 256) - 1) + return "2**256-1"; + else if (_x.denominator() == 1) return _x.numerator().str(); else return _x.numerator().str() + "/" + _x.denominator().str();