The documentation at
https://dlang.org/library/std/range/iota.html
currently states
"The two-argument overloads have step = 1. If begin < end
&& step < 0 or begin > end && step > 0 or begin == end,
then an empty range is returned."
However, the implementation for floating point types does not match documentation:
import std;
void test(T)() {
assert(iota(T(1), T(2), T(-1)).empty);
assert(iota(T(2), T(1)).empty); // By-default step==1
assert(iota(T(3), T(3)).empty); // By-default step==1
}
void main() {
test!int; // Produces empty ranges: GOOD
test!double; // asserts: BAD
}
See the following thread for further discussion:
https://forum.dlang.org/thread/[email protected]
Comment #1 by robert.schadek — 2024-12-01T16:40:58Z