在遍历过程中,遇到两个大数相乘结果为负数,如何修改得到正确的结果? | python | python 技术论坛-jiuyou九游娱乐官方


int64最大值为:9223372036854775807, 溢出了。
改为 uint64 或 float64:
>>> y1 = np.array([31762334353454354546546546576587], dtype='float64')
>>> y2 = np.array([4233451232010529434234354654645656546546456], dtype='float64')
>>> k = np.array(y1 * y2, dtype='float64')
>>> k
array([1.34464294e 74])
请登录
int64最大值为:9223372036854775807, 溢出了。
改为
uint64或float64: