auto x = -1234890712367412347124895720349587;
Output:
app.d(1): Error: integer overflow
That is an underflow, not an overflow.
Comment #1 by ag0aep6g — 2021-03-25T14:47:24Z
(In reply to Ajieskola from comment #0)
> auto x = -1234890712367412347124895720349587;
>
> Output:
> app.d(1): Error: integer overflow
>
> That is an underflow, not an overflow.
It's overflow. Underflow is when a floating point value is too close to zero.
From <https://en.wikipedia.org/wiki/Integer_overflow>: "an integer overflow occurs when an arithmetic operation attempts to create a numeric value that is outside of the range that can be represented with a given number of digits – either higher than the maximum or lower than the minimum representable value."
From <https://en.wikipedia.org/wiki/Arithmetic_underflow>: "Storing values that are too low in an integer variable (e.g., attempting to store −1 in an unsigned integer) is properly referred to as integer overflow, or more broadly, integer wraparound."
Could call it "wraparound" in the error message to avoid confusion.
Comment #2 by Ajieskola — 2021-03-25T17:15:51Z
Staying in standard terminology is good enough IMO. My misunderstanding.