128 bit signed and unsigned integer types

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Dec 28 09:25:23 PST 2008


Don wrote:
> Walter Bright wrote:
>> You know, the unimplemented 128 bit integer types.
>>
>> Does anyone have a use for these?
> 
> I would have liked them when implementing a fallback (non-asm) bigint 
> implementation for 64-bit CPUs. Actually the only operations required are:
> ulong * ulong -> ulong[2]
> ulong[2] / ulong = ulong (only the case where it doesn't overflow, is 
> required)
> ulong + ulong = ulong[2]
> ulong - ulong = ulong[2]
> 
> Otherwise, it's hard to imagine many cases where 64 bits are inadequate 
> but 128 bits are enough. Actually there are very few cases where 32 bits 
> are inadequate but 64 bits are enough.

For the latter, file sizes come to mind:o).

Andrei



More information about the Digitalmars-d mailing list