D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4461 - iota completely broken when using negative integers
Summary: iota completely broken when using negative integers
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: Other Windows
: P2 major
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-14 12:25 UTC by David Simcha
Modified: 2010-08-10 20:59 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description David Simcha 2010-07-14 12:25:08 UTC
Test Case:

import std.range, std.array, std.stdio;

void main() {
    writeln(array(iota(-5, 5)));      // FAIL
    writeln(array(iota(-5, 5, 1)));   // FAIL
    writeln(array(iota(-5.0, 5.0)));  // Works.
}


Output:  
4294967291 4294967292 4294967293 4294967294 4294967295 0 1 2 3 4
4294967291 4294967292 4294967293 4294967294 4294967295 0 1 2 3 4
-5 -4 -3 -2 -1 0 1 2 3 4
Comment 1 kennytm 2010-08-09 11:13:35 UTC
Cannot reproduce on Phobos r1824. I think it is fixed already.
Comment 2 David Simcha 2010-08-10 20:59:26 UTC
You're right.  Iota was revamped for 2.048 and this apparently got fixed.