June 23, 2021 [Issue 21215] std.range.recurrence leads to an infinite loop | ||||
|---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=21215 Ajieskola@gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |Ajieskola@gmail.com Resolution|--- |INVALID --- Comment #1 from Ajieskola@gmail.com --- This is intended behaviour. When recurrency function is called with 0, sequence.dropExactly is called with 0ul - 1, which overflows to ulong.max. The code is multiplying the previous factorial ulong.max times. It is not an infinite loop literally, but would presumably take thousands of years to complete. -- | ||||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply