March 25, 2021 [Issue 21767] Underflow reported as overflow | ||||
|---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=21767 ag0aep6g <ag0aep6g@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ag0aep6g@gmail.com --- Comment #1 from ag0aep6g <ag0aep6g@gmail.com> --- (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. -- | ||||
March 25, 2021 [Issue 21767] Underflow reported as overflow | ||||
|---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=21767 Ajieskola@gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |INVALID --- Comment #2 from Ajieskola@gmail.com --- Staying in standard terminology is good enough IMO. My misunderstanding. -- | ||||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply