Mir Random [WIP]

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Thu Nov 24 11:37:05 PST 2016


On 24.11.2016 14:50, Kagamin wrote:
> On Thursday, 24 November 2016 at 12:02:22 UTC, John Colvin wrote:
>> Because it's correct. If a.length is larger than int.max then
>> cast(int)a.length will half the time be negative and therefore a
>> simple rightshift would not be equivalent to division by 2.
>
> It can't be possibly correct when a.length is larger than int.max
> because it doesn't recover information lost in a narrowing conversion.

The code does not specify that this information should be recovered. Why 
is this the compiler's problem?


More information about the Digitalmars-d mailing list