https://issues.dlang.org/show_bug.cgi?id=15720

Ender KaShae <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #1 from Ender KaShae <[email protected]> ---
This happens because the operation to compute the length is

```
unsigned((start - stop) / -step)
```

but `long.max - long.min` overflows the long and results in -1. 

The reason it works for a step of 1 is that -1 is cast to a ulong, which
results in the maximum value of ulong (18446744073709551615). 

Maybe this could be fixed by casting to the unsigned type before dividing by
the step.

--

Reply via email to