跳转至

__builtin

函数 描述
__builtin_ctz(int x) 返回 int x 二进制中末尾 0 的个数 check tail zero
__builtin_ctzll(long long x) 返回 long long x 二进制中末尾 0 的个数 check tail zero long long
__builtin_clz(int x) 返回 int x 二进制中前导 0 的个数 check lead zero
__builtin_clzll(long long x) 返回 long long x 二进制中前导 0 的个数 check lead zero long long
__builtin_popcount(int x) 返回 int x 二进制中 1 的个数 pop count
__builtin_popcountll(long long x) 返回 long long x 二进制中 1 的个数 pop count long long
__builtin_parity(int x) 返回 int x 二进制中 1 的个数的奇偶性(1, 0) parity
__builtin_parityll(long long x) 返回 long long x 二进制中 1 的个数奇偶性(1, 0) parity long long
__builtin_ffs(int x) 返回 int x 二进制中 最后一个 1 的位置(base 1) front first seat
__builtin_ffsll(long long x) 返回 long long x 二进制中 最后一个 1 的位置(base 1) front first seat long long
__builtin_sqrt(double x) 返回 \(\sqrt {double\ x}\) 的值 sqrt
__builtin_sqrtf(float x) 返回 \(\sqrt {float\ x}\) 的值 sqrt float