assertion failure in std.range.iota

Andrej Mitrovic andrej.mitrovich at gmail.com
Thu Aug 18 17:18:39 PDT 2011


import std.range;
import std.stdio;

void main()
{
    auto r1 = iota(0.0, 4.0, 0.03);  // ok
    auto r2 = iota(0.0, 3.0, 0.03);  //
core.exception.AssertError at std.range(4001): Assertion failure
}

I want a range in steps of 0.03, beginning at 0.0 and ending at the
closest point to 3.0.

Line 4001 is:
assert(start + count * step >= end);

This assertion and the code above it make absolutely no sense to me.
The intention would be more clear if there was an error message, or
any documentation of the implementation, but no dice.


More information about the Digitalmars-d-learn mailing list