| 133 | |
| 134 | |
| 135 | unsigned int BitPrecision(word value) |
| 136 | { |
| 137 | if (!value) |
| 138 | return 0; |
| 139 | |
| 140 | unsigned int l = 0, |
| 141 | h = 8 * sizeof(value); |
| 142 | |
| 143 | while (h-l > 1) |
| 144 | { |
| 145 | unsigned int t = (l+h)/2; |
| 146 | if (value >> t) |
| 147 | l = t; |
| 148 | else |
| 149 | h = t; |
| 150 | } |
| 151 | |
| 152 | return h; |
| 153 | } |
| 154 | |
| 155 | |
| 156 | word Crop(word value, unsigned int size) |
no outgoing calls
no test coverage detected