mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Simplify tostring.
This commit is contained in:
parent
9ec7cf88ec
commit
afc56db6d5
@ -58,7 +58,11 @@ void resizeAndSet(vector<T>& _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();
|
||||
|
Loading…
Reference in New Issue
Block a user