奇怪的乘法误差 [英] Strange multiplication error
本文介绍了奇怪的乘法误差的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
为什么会这样简单:
System.out.println("test problem: " + 194*194*194*409);
输出如下内容:
test problem: -1308701240
推荐答案
因为您溢出了一个整数.请参阅Java文档中有关整数处理的数字的限制.
Because you've overflowed an integer. See the limits on the numbers handled by integers in the java documentation.
这篇关于奇怪的乘法误差的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文