Talk:Integer overflow

message: Integer arithmetics are frequently used in computer programs on all types of systems, since floating-point operations may incur higher overhead (depending on processor capabilities).
Floating-point operations may or may not actually be more expensive than integer arithmetic on given hardware. I think there are much better reasons to use integers instead of floats: integers are exact and give you more precision than floats of the same size. For example, in a 32-bit integer, you get 32 bits of precision, whereas an IEEE single precision float, which also takes 32 bits, provides only 24 bits of precision (23 bits mantissa, and the sign bit). When the numbers you're trying to represent are integers (or even rationals with a common denominator), you're therefore better off using ints.
Inglorion 09:27, 19 August 2006 (UTC)
thread_title: [Untitled]

message: Integer overflow is a special case of arithmetic overflow.  I don't see the need for two articles.   Derek farn 08:54, 10 October 2006 (UTC)
replies: text: But, currently, the arithmetic overflow page adds no significant value, and only confuses because there is no obvious difference between integer overflow and arithmetic overflow.  In fact, the first line of 'integer overflow' says  "an integer overflow occurs when an arithmetic operation attempts to create a numeric value that is too large to be represented...", which is exactly the definition of arithmetic overflow.  Until there is something in the two articles that shows a difference between these two terms, they really should be merged. 141.166.41.125 (talk) 21:05, 6 September 2015 (UTC)
thread_title:  Merge with [[arithmetic overflow]] 

message: From the article:
:Since an arithmetic operation may produce a result larger than the maximum representable value, a potential error condition may result. In the C programming language, signed integer overflow causes undefined behavior, while unsigned integer overflow causes the number to be reduced modulo a power of two, meaning that unsigned integers "wrap around" on overflow. This "wrap around" is the cause of the famous "Split Screen" in Pac-Man.
:A "wrap around" corresponds to the fact, that e.g. if the addition of two positive integers produces an overflow, it may result in a negative number. In counting, one just starts over again from the bottom.
:Example: 16 bit signed integer: 30000 + 30000 = −5536.
The example given here of a negative number resulting from addition is an example of a signed integer overflow, but its usage immediately after the statement about C programming behavior is contradictory. I don't know enough about C programming to know whether the statement that "signed overflow produces undefined behavior, while unsigned overflow produces wrap around" is accurate or transposed. If it is accurate, the example should be changed to, perhaps, 35000 + 35000 = 4464; otherwise, the words "signed" and "unsigned" words should be swapped to be accurate in the preceding statement.
199.2.205.141 (talk) 14:15, 29 October 2013 (UTC)
replies: text:  Signed overflow is undefined in C. I changed the example to prevent confusion. Hiiiiiiiiiiiiiiiiiiiii (talk) 01:52, 13 January 2014 (UTC)
thread_title:  Wrap around, Signed/Unsigned, mixed message 

message: I propose that Arithmetic overflow be merged into Integer overflow. The arithmetic overflow article is short and underdeveloped, and duplicates the material in integer overflow.  Ads they currently stand, there is no apparent difference in definition between the two terms. 141.166.41.125 (talk) 21:05, 6 September 2015 (UTC)
thread_title:  Merger proposal 

message: The definition of integer underflow is incorrect. Integer overflow is the blanket term for where a value exceeds the range of an integer. When the maximum value is exceeded, this is positive overflow. When the minimum value is exceeded, this is negative overflow -- not underflow!
Integer underflow is a less remarkable example of information loss, where precision is lost due to an arithmetic operation such as integer division or bitwise right-shift, or due to a conversion from a type that can represent fractional values, e.g. floating-point. For example, where 3 / 2 = 1, we are seeing integer underflow.
The references to integer underflow are misleading. There will always be more examples of the misuse of the term integer underflow than examples of its correct use, because the proportion of material concerned with integer overflow far exceeds that concerned with integer underflow. Thus a picture is painted of a general consensus around the incorrect definition. Of the five citations, the first is an article CWE-191 which gets the definition of underflow wrong. The second has only one reference which is a broken link. The third has a mistake by its own definition (-1 is not a smaller absolute value than 0). The fourth, again, is using the wrong definition of integer underflow. The fifth begins by talking about buffer underflow and then continues the semantics into a section on integers.
The preceding wikipedia article  gets the definition of integer overflow right and even describes the example from the third underflow article as integer overflow. (But then it scores an own goal by saying this is integer wraparound. Ouch!)
Some of these citations are great examples of the ambiguity and require only minor clean-up. However the conclusion the draw is wrong. In particular, the following sentence is factually wrong and should be amended from
    When the term integer underflow is used, it means the ideal result was closer to minus infinity than the output type's representable value closest to minus infinity.
to:
    When the term integer underflow is used, it is often taken to mean the ideal result was closer to minus infinity than the output type's representable value closest to minus infinity.  — Preceding unsigned comment added by 95.44.211.219 (talk) 07:48, 1 September 2019 (UTC)
thread_title:  Ambiguity Regarding underflow 

message: At :
"Due to the continued growth of GenBank, NCBI will soon begin assigning GIs exceeding the signed 32-bit threshold of 2,147,483,647 for those remaining sequence types that still receive these identifiers. The exact date that the 32-bit threshold will be crossed depends on submission volume and is projected for late 2021."
This can be another example?  
Proposal:  I feel that there should be a more generalised Wikipedia article grouping topics that include Year 2000 problem, IPv4 address exhaustion and Integer overflow.  These all relate to the same fundamental idea:  problems (often unforeseen or ignored) arising from use of integer types with a maximum value that can eventually be exceeded.  
—DIV (1.145.43.213 (talk) 06:48, 5 September 2021 (UTC)
thread_title:  Example:  accession numbers 

message: It should be using Minecraft: Java Edition and Minecraft: Bedrock edition instead of "Windows 10 Edition"/"Pocket Edition"/"Minecraft". Bedrock edition also no longer has the far lands, and they were always different on bedrock. Eteled286 (talk) 23:59, 28 September 2022 (UTC)
thread_title:  Minecraft 

message: The article says that integer overflow does not occur for unsigned integers in the C11 standard. This is true, but slightly misleading as readers will think it is a C11 innovation. Actually the same thing was true in the ANSI/C89 standard (3.1.2.5) and the C99 standard (6.2.5).
Apart from one word that seems redundant, both those standards have the same sentence as appears in C11. Zerotalk 04:28, 29 January 2023 (UTC)
thread_title:  unsigned integers