Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Hamish Jones   on Aug 24 In Java Category.

  
Question Answered By: Julian Long   on Aug 24

You are experiencing an overflow error. The number in the
multiplication is larger than the maximum a normal int  can hold. It
goes negative due to 2's complement notation. By splitting the
multiplications, you keep the products in an int's range until it can
be stored in a long, at which point the maximum is bumped up.

Share: 

 

This Question has 1 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on java bug ? Or get search suggestion and latest updates.


Tagged: