MCPcopy Create free account
hub / github.com/Tripwire/tripwire-open-source / BitPrecision

Function BitPrecision

src/cryptlib/misc.cpp:46–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46unsigned int BitPrecision(unsigned long value)
47{
48 if (!value)
49 return 0;
50
51 unsigned int l=0, h=8*sizeof(value);
52
53 while (h-l > 1)
54 {
55 unsigned int t = (l+h)/2;
56 if (value >> t)
57 l = t;
58 else
59 h = t;
60 }
61
62 return h;
63}
64
65unsigned long Crop(unsigned long value, int size)
66{

Callers 6

DivideFunction · 0.85
RoundupSizeFunction · 0.85
BitCountMethod · 0.85
integer.cppFile · 0.85
ShortDivideMethod · 0.85
GetLongMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected