Linux内核中64位除法函数do_div

来源:互联网 发布:办公室网络搭建 编辑:程序博客网 时间:2024/05/16 11:26

使用asm/div64.h中宏do_div

 

#include <asm/div64.h>

unsigned long long x,y,result;

unsigned long mod;

mod = do_div(x,y);

result = x; 

 

    64 bit division 结果保存在x中;余数保存在返回结果中。

     

原创粉丝点击