You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Delphi中通过位运算将Int64拆分为两个整数?

我的解决方案

最初我写的代码是这样的:

IntLo := Integer(Value and $FFFFFFFF);
IntHi := Integer((Value shr 32) and $FFFFFFFF);

但我不确定这是不是性能最优的实现方式。

*编辑:
后来我意识到完全不需要做按位与操作,简化后的代码如下:

IntLo := Integer(Value);
IntHi := Integer(Value shr 32);

内容的提问来源于stack exchange,提问作者Wolf Country

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.09 05:20:29