MCPcopy Create free account
hub / github.com/argotorg/solidity / fitsIntoBits

Function fitsIntoBits

libsolidity/ast/Types.cpp:86–95  ·  view source on GitHub ↗

Checks whether _value fits into _bits bits when having 1 bit as the sign bit if _signed is true.

Source from the content-addressed store, hash-verified

84/// Checks whether _value fits into _bits bits when having 1 bit as the sign bit
85/// if _signed is true.
86bool fitsIntoBits(bigint const& _value, unsigned _bits, bool _signed)
87{
88 return fitsIntegerType(
89 _value,
90 *TypeProvider::integer(
91 _bits,
92 _signed ? IntegerType::Modifier::Signed : IntegerType::Modifier::Unsigned
93 )
94 );
95}
96
97util::Result<TypePointers> transformParametersToExternal(TypePointers const& _parameters, bool _inLibrary)
98{

Callers 1

Calls 1

fitsIntegerTypeFunction · 0.85

Tested by

no test coverage detected