C++ Logo


Advanced search

Re: [ub] An update on signed integers

From: Florian Weimer <fw_at_[hidden]>
Date: Sun, 29 Apr 2018 22:21:43 +0200
* JF Bastien:

> On Sun, Apr 29, 2018 at 12:43 PM Florian Weimer <fw_at_[hidden]> wrote:
>> * JF Bastien:
>> >>> Thanks. Please change the name of the proposal. Its contents is
>> >>> fine, but it doesn't really deliver two's complement signed integers.
>> > I’ll consider your request if you also provide a rationale for it.
>> Personally, I strongly associate two's complement integers with the
>> usual wraparound behavior and the lack of padding bits and trap
>> representations.
> Sounds like an opinion. I’d rather not bikeshed names based on opinion,
> especially given the preceding discussions of the paper. Sounds like you
> got 2/3 if what you feel like you want, and you also got representation and
> value range for free. Happy to hear solid arguments otherwise.

I'm not aware of any description of two's complement (except the one
in the C standard) which does not justify its significance by the
arithmetic properties.

Even the current C++ draft uses two's complement to describe
arithmetic properties:

| For signed integer types, arithmetic is defined to use two's
| complement representation. There are no undefined results.

Received on 2018-04-29 22:21:47