Integer Overflow

Why Trust Techopedia

What Does Integer Overflow Mean?

Integer overflow is the result of an attempt by a CPU to arithmetically generate a number larger than what can fit in the devoted memory storage space. Arithmetic operations always have the potential of returning unexpected values, which may cause an error that forces the whole program to shut down. For this reason, most programmers prefer to perform mathematical operations inside an exception frame, which returns an exception in the case of integer overflow instead.

Advertisements

Integer overflow is also known as arithmetic overflow.

Techopedia Explains Integer Overflow

One example of integer overflow could occur when a program developer does not allow for the occurrence of a negative number. In this case, if a variable performs an operation resulting in a negative number, an overflow occurs and the variable is returned as a positive integer. Another example of integer overflow would be dividing a number by zero, which mathematically yields a large number with an infinite value.

A processor's behavior in the event of an integer overflow differs from one processor to another. Graphics processing units and digital signal processors are engineered to deal with many arithmetic conditions, including integer overflow. In an instance of integer overflow, these processors typically return the maximum number allowed.

Advertisements

Related Terms

Margaret Rouse
Editor

Margaret jest nagradzaną technical writerką, nauczycielką i wykładowczynią. Jest znana z tego, że potrafi w prostych słowach pzybliżyć złożone pojęcia techniczne słuchaczom ze świata biznesu. Od dwudziestu lat jej definicje pojęć z dziedziny IT są publikowane przez Que w encyklopedii terminów technologicznych, a także cytowane w artykułach ukazujących się w New York Times, w magazynie Time, USA Today, ZDNet, a także w magazynach PC i Discovery. Margaret dołączyła do zespołu Techopedii w roku 2011. Margaret lubi pomagać znaleźć wspólny język specjalistom ze świata biznesu i IT. W swojej pracy, jak sama mówi, buduje mosty między tymi dwiema domenami, w ten…