* @brief Returns the number of bits needed to encode the given number. */
| 24 | * @brief Returns the number of bits needed to encode the given number. |
| 25 | */ |
| 26 | unsigned bitSizeOfNumber(unsigned long long v) { |
| 27 | unsigned int r = 0; |
| 28 | while (v >>= 1) { |
| 29 | r++; |
| 30 | } |
| 31 | return r + 1; |
| 32 | } |
| 33 | |
| 34 | } // namespace utils |
| 35 | } // namespace retdec |