Revisiting integer multiplication overflow

Eyas El‐Qawasmeh, Ahmed Dalalah · International Conference on Software Engineering · 2005

Online problems arise in various applications ranging from load balancing and scheduling to network and financial problems. However, some of these online applications like financial tools, online calculators and online math programs suffer from the overflow problem caused by the multiply operation of two operands. The overflow occurs whenever the multiplication of any two-integer numbers exceeds the maximum limit available for the result. Many programming languages ignored this problem; therefore, the programmer has to handle it, mostly in predict and avoid approach. This paper addresses the detection and control of integer overflow in programming languages. Two examples from C and Java programming languages are considered. The paper suggests detect and do algorithms to handle the overflow. In addition, this paper suggests adding a built-in function to test whether an overflow will be generated by multiplication operation in advance.

Read the paper · More papers on PaperTik