C++ Club cover image

Meeting 142

C++ Club

00:00

Using Unsigned Intages for Arithmetic?

Most code incorrectly chooses to use signed integes almost exclusively. Dale examines all the usual arguments in favor of signedinteges and tries to dismantle them with varying success, sometimes using questionable seplus plus code. And iam not sure what to think. Unsigned multiplication can overflow sentinel values. Eh, bestial sizes are unsigned. There is a section called your counter arguments are about pathological inputs. In which the author dismisses the argument out of hand. His arguments for unsigned are, most intages in the program never represent negative values. While talk about generalization, compiler diagnostics are better for unsigned. And checking for overflow and underflow is easier and safer.

Transcript
Play full episode

The AI-powered Podcast Player

Save insights by tapping your headphones, chat with episodes, discover the best highlights - and more!
App store bannerPlay store banner
Get the app