|
Boost : |
Subject: Re: [boost] Current Guidance on Compiler Warnings?
From: Daniela Engert (dani_at_[hidden])
Date: 2018-11-24 19:06:57
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
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk