cppbestpractices icon indicating copy to clipboard operation
cppbestpractices copied to clipboard

Underflow / overflow terms are used incorrectly

Open Xeverous opened this issue 6 years ago • 2 comments

03-Style - line 368

The text mentions "integer underflow". There is no such thing. Underflow (that is, truncation to zero) happens only for floating point types.

https://stackoverflow.com/questions/6360049/what-are-arithmetic-underflow-and-overflow-in-c

Xeverous avatar Aug 22 '19 11:08 Xeverous

Curious. I always thought integer underflow meant passing the lowest representable number. Not sure if I am too happy with calling it integer overflow or integer wrap-around instead.

maz3max avatar Sep 04 '19 15:09 maz3max

Think of overflow as an absolute value that is too large to fit inside.

Xeverous avatar Sep 04 '19 22:09 Xeverous