24 Nov
2018
24 Nov
'18
7:06 p.m.
Am 24.11.2018 um 19:48 schrieb Emil Dotchevski via Boost:
The problem with signed/unsigned mismatch is not just in the comparison, but also in the operations. If unsigned x=2, the expression x-3 may not be meaningfully represented by an unsigned integer.
Au contraire, mon ami! Unsigned arithmetic is defined in C++ as an abelian ring modulo a value depending on the width of the given unsigned type. In fact, unsigned types are the only useful types if you need well-defined mathematical properties (like I do when it comes to digital signal processing). Ciao Dani