Linux内核中64位除法函数do_div

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.

你可能感兴趣的:(linux内核,do_div,除法函数)