Date: Wed, 11 Dec 2024 04:30:25 +0300
On 12/11/24 02:31, Tom Honermann wrote:
> On 12/10/24 5:55 PM, Andrey Semashev via Std-Proposals wrote:
>>
>> I think using signed integers for sizes and offsets is wrong because
>> those values are never negative. Signed types simply mis-document the
>> interface and confuse the users. And then frustrates the users if they
>> want to fix the issue in their end.
>
> Divisors are never zero. Should we introduce an integer type that
> doesn't have representation of 0 so that programmers can't ever
> accidentally divide by zero?
If divisors were as ubiquitous as non-negative integers, perhaps we
should have. But they are not.
> On 12/10/24 5:55 PM, Andrey Semashev via Std-Proposals wrote:
>>
>> I think using signed integers for sizes and offsets is wrong because
>> those values are never negative. Signed types simply mis-document the
>> interface and confuse the users. And then frustrates the users if they
>> want to fix the issue in their end.
>
> Divisors are never zero. Should we introduce an integer type that
> doesn't have representation of 0 so that programmers can't ever
> accidentally divide by zero?
If divisors were as ubiquitous as non-negative integers, perhaps we
should have. But they are not.
Received on 2024-12-11 01:30:28