• queerlilhayseed@piefed.blahaj.zone
    cake
    link
    fedilink
    English
    arrow-up
    8
    ·
    7 days ago

    Hold on to those glasses for a second. I searched for “integer underflow” and the first result was the wikipedia article for Integer Overflow which has this passage in the “Definition variations and ambiguity” section:

    The case of an integer operation producing a value less than the smallest representable value is sometimes called integer underflow, though most commonly it is known as a type of overflow.[30] This usage is quite different from floating-point underflow, which refers to a floating-point value that is too close to 0.

    That citation points to this definition on mitre (formatted for clarity):

    CWE-191: Integer Underflow (Wrap or Wraparound): The product subtracts one value from another, such that the result is less than the minimum allowable integer value, which produces a value that is not equal to the correct result.

    Integer underflow refers to a type of overflow (that is, an overflowing of the minimum bound instead of the maximum bound) and it’s a different thing than floating point precision loss. To use the odometer example from Wikipedia, it would be like running the odometer backward until it goes from 000000 to 999999, which is an invalid result since 0 - 1 =/= 999999.

    Given the evidence, I move that the council of pedants keep /u/verdare’s glasses pushed up. I further move that they get bonus pedantry points since they are both technically correct and needlessly specific, since it is also true that “overflow” is correct in this case, which is the most pedantic kind of correct :)