MCPcopy Create free account
hub / github.com/ElementsProject/elements / bits

Method bits

src/arith_uint256.cpp:171–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169
170template <unsigned int BITS>
171unsigned int base_uint<BITS>::bits() const
172{
173 for (int pos = WIDTH - 1; pos >= 0; pos--) {
174 if (pn[pos]) {
175 for (int nbits = 31; nbits > 0; nbits--) {
176 if (pn[pos] & 1U << nbits)
177 return 32 * pos + nbits + 1;
178 }
179 return 32 * pos + 1;
180 }
181 }
182 return 0;
183}
184
185// Explicit instantiations for base_uint<256>
186template base_uint<256>::base_uint(const std::string&);

Callers 4

arith_uint256.cppFile · 0.80
FUZZ_TARGET_INITFunction · 0.80
FreedesktopImageMethod · 0.80

Calls

no outgoing calls

Tested by 1

FUZZ_TARGET_INITFunction · 0.64