
参见http://en.wikipedia.org/wiki/Arithmetic_overflow
要在Java中修复,请尝试使用a
long代替。
int progress = (int) ((byte_counter * 100L) / size);
或相反的 *** 作顺序
int progress = (int) (((float) byte_counter) / size) * 100);
欢迎分享,转载请注明来源:内存溢出

参见http://en.wikipedia.org/wiki/Arithmetic_overflow
要在Java中修复,请尝试使用a
long代替。
int progress = (int) ((byte_counter * 100L) / size);
或相反的 *** 作顺序
int progress = (int) (((float) byte_counter) / size) * 100);
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)