Revisiting integer multiplication overflow

  • Authors:
  • Eyas El-Qawasmeh;Ahmed Dalalah

  • Affiliations:
  • Computer Science Dept., Jordan University of Science and Technology;Computer Science Dept., Jordan University of Science and Technology

  • Venue:
  • SEPADS'05 Proceedings of the 4th WSEAS International Conference on Software Engineering, Parallel & Distributed Systems
  • Year:
  • 2005

Quantified Score

Hi-index 0.00

Visualization

Abstract

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.