Add mini-interpreter to check representation.

This commit is contained in:
chriseth
2019-05-28 11:35:07 +02:00
parent 1c16124a09
commit cee1340113
3 changed files with 72 additions and 14 deletions
+14
View File
@@ -91,6 +91,20 @@ inline u256 s2u(s256 _u)
return u256(c_end + _u);
}
inline u256 exp256(u256 _base, u256 _exponent)
{
using boost::multiprecision::limb_type;
u256 result = 1;
while (_exponent)
{
if (boost::multiprecision::bit_test(_exponent, 0))
result *= _base;
_base *= _base;
_exponent >>= 1;
}
return result;
}
inline std::ostream& operator<<(std::ostream& os, bytes const& _bytes)
{
std::ostringstream ss;