Revisiting Overflow in Integer Multiplication
Eyas El-Qawasmeh & Ahmed Dalalah
Journal of Computer Science, Volume 1, Issue 3, pp. 304–309 · doi.org/10.3844/jcssp.2005.304.309
Abstract
Integer multiplication is a very common operation that is executed in many applications. However, some of these applications 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. Present study 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.
Licence and reuse
Free to read. This article carries the publisher’s copyright, as printed on it: © 2005 Science Publications. It is free to read; ask us before reusing it.
How to reuse this articleResponses (0)
About this article
El-Qawasmeh, E. & Dalalah, A. (2005). Revisiting Overflow in Integer Multiplication. Journal of Computer Science, 1(3), 304–309. https://doi.org/10.3844/jcssp.2005.304.309
- Licence
- © Science Publications
- Issue
- Volume 1, Issue 3
- Policies
- Editorial independenceUse of generative AIData availabilityAppeals and complaints
- Version
- Version of record
