gpt4 book ai didi

c++ - 在 x + y 中获取 "carry"

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:02:50 25 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
Best way to detect integer overflow in C/C++

如果我有一个表达式 x + y(在 C 或 C++ 中),其中 xy 都是 uint64_t 类型 导致整数溢出,我如何检测它溢出了多少(进位),将 than 放在另一个变量中,然后计算余数?

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com