length's type.

monkyyy crazymonkyyy at gmail.com
Sun Jan 28 17:09:42 UTC 2024


On Sunday, 28 January 2024 at 16:16:34 UTC, Olivier Pisano wrote:
> On Sunday, 28 January 2024 at 08:55:54 UTC, zjh wrote:
>> On Sunday, 28 January 2024 at 06:34:13 UTC, Siarhei Siamashka 
>> wrote:
>>>
>>> The explicit conversion `.length.to!int` has an extra benefit
>>
>>
>> I rarely use numbers over one million.
>>
>> But do I have to consider numbers over `4 billion` every day?
>
> If .length were to be an int, D could not handle array of more 
> than 2G bytes. The whole language would be useless on 64 bit 
> systems.

_Of bytes_ and if your messing with the type and still think 
that's an important concern you could make it a long for 63 bits 
and no silly 0-1 behavior

a signed index of a datatype that is 2 words will still compete 
with the mythical computer ram of a max ram 64 bit machine; if 
you have 64^2 ubytes maybe you should rotate your prospective and 
store 256 counts of each.




More information about the Digitalmars-d-learn mailing list