GDC adds intrinsic support for core.checkedint

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Thu Jul 2 19:17:34 PDT 2015


On 07/02/2015 11:22 PM, Robert burner Schadek wrote:
> On Thursday, 2 July 2015 at 20:24:55 UTC, tsbockman wrote:
>>
>> I don't see why the closed-ness of the integers under an operation
>> should determine whether it makes the cut or not, but if that's the
>> standard:
>
> I wanted to have an Integral type. And Math Integrals only have the base
> operations add and mul. Shift just feels wrong to me.
> ...

You're going to need more justification than that.

>>
>> The built-in integer types are truly closed under the bitwise
>> operators `~`, `&`, `|`, and `^`, with no overflow, underflow, or
>> undefined combinations.
>
> Bitwise are no math operations, these are CS operations
>
> In the end it is a design decision. And that's how I chose.
>

Some designs are better than others.



More information about the Digitalmars-d mailing list