Linux内核中64位除法函数do_div

来源:互联网 发布:网页设计 php源代码 编辑:程序博客网 时间:2024/05/14 11:35
In linux kernel, a 64 bit division is not supported by fault. 
* We need to use do_div macro available in asm/div64.h. 

* #include<asm/div64.h>
* usigned long long x,y,result;
* usigned long mod;
* mod = do_div(x,y);
* result = x;

* The result ofdivision is in x,the remainder is returned from the do_div function to mod.
0 0