tools
byd yes
这个作者很懒,什么都没留下…
展开
-
记录linux内核开立方函数
#include <stdio.h>#include <math.h>typedef unsigned long u64;typedef unsigned int u32;typedef unsigned char u8;#define __WORDSIZE 64#define BITS_PER_LONG __WORDSIZEstatic __always_inline unsigned long __fls(unsigned long word){ in.原创 2021-08-02 14:35:50 · 697 阅读 · 0 评论 -
ffs函数
ffs()函数用于查找一个整数中的第一个置位值(也就是bit为1的位)。函数原型:#include <stdio.h>#include <string.h>#include <stdlib.h>int main(int argc, char **argv){ printf("%d\n", ffs(atoi(argv[1])));}测试:ffs 11ffs 22ffs 31ffs 84ffs..原创 2021-07-16 09:19:54 · 1062 阅读 · 0 评论