【发布时间】:2019-08-17 10:39:07
【问题描述】:
我需要帮助扭转这个转换逻辑:
word0 = np.uint32(3333333333)
word1 = np.uint32(1111111111)
temp64 = np.uint64(word0) * 1000000000
temp64 = temp64 + np.uint64(word1)
temp64 现在保存时间戳的值。我需要将其转换回两个 32 位整数并到达 word0 = 3333333333 和 word1 = 1111111111
word0 = np.uint32(3333333333) # 32bit
word1 = np.uint32(1111111111) # 32bit
temp64 = np.uint64(word0) * 1000000000
temp64 = np.uint64(temp64) + np.uint64(word1)
temp32_0 = np.uint64((temp64)/1000000000)
temp32_1 = np.uint64(temp64%1000000000)
print(temp32_0)
print(temp32_1)
输出:
3333333334
111111168
我要回去了
3333333333
1111111111
【问题讨论】:
标签: python numpy math 32bit-64bit bit