64位除法 [英] 64 bit division

查看:320
本文介绍了64位除法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能给我交流code分2 64位数字。我的编译器只支持32/32分裂。

Can anyone send me a c code to divide 2 64bit numbers. My compiler only supports 32/32 division.

感谢名单和放大器;问候

Thanx & Regards

玛尼

推荐答案

您正编译器不支持64位除法?如果你的C编译器支持C99,这应该工作:

Are you positive your compiler doesn't support 64-bit division? If your C compiler supports C99, this should work:

#include <stdint.h>
#include <stdio.h>
int main(void)
{
    int64_t numerator = 123;
    int64_t denominator = 10;
    int64_t quotient = numerator / denominator
    printf("%" PRId64 " / %" PRId64 " = %" PRId64 "\n",
           numerator, denominator, quotient);
    return 0;
}

这篇关于64位除法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆