2的最小整数对数

xiaoxiao2021-02-28  4

short log2US16(unsigned short a) { short zero = 0; if (a == 0) return 0; if (!(0xFF00 & (a << zeros))) zero += 8; if (!(0xF000 & (a << zeros))) zero += 4; if (!(0xC000 & (a << zeros))) zero += 2; if (!(0x8000 & (a << zeros))) zero += 1; return (15 - zero); }
转载请注明原文地址: https://www.6miu.com/read-1100282.html

最新回复(0)