Disambiguate bytesRequired

This commit is contained in:
chriseth
2021-09-22 11:22:07 +02:00
parent d9ad047c21
commit 50ce1f5ddd
7 changed files with 15 additions and 15 deletions
+2 -2
View File
@@ -1135,7 +1135,7 @@ IntegerType const* RationalNumberType::integerType() const
return nullptr;
else
return TypeProvider::integer(
max(util::bytesRequired(value), 1u) * 8,
max(util::numberEncodingSize(value), 1u) * 8,
negative ? IntegerType::Modifier::Signed : IntegerType::Modifier::Unsigned
);
}
@@ -1169,7 +1169,7 @@ FixedPointType const* RationalNumberType::fixedPointType() const
if (v > u256(-1))
return nullptr;
unsigned totalBits = max(util::bytesRequired(v), 1u) * 8;
unsigned totalBits = max(util::numberEncodingSize(v), 1u) * 8;
solAssert(totalBits <= 256, "");
return TypeProvider::fixedPoint(