现在的位置: 首页 > 综合 > 正文

Linux内核中64 bit division

2012年01月18日 ⁄ 综合 ⁄ 共 146字 ⁄ 字号 评论关闭

 

使用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中;余数保存在返回结果中。

抱歉!评论已关闭.