public static int BitLengthUnsigned(uint x) { if (x >= 1u << 31) { return 32; } return BitLength((int)x); }