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.

Reply via email to