Skip to content

Commit

Permalink
Fix 15033
Browse files Browse the repository at this point in the history
  • Loading branch information
nordlow committed Sep 10, 2015
1 parent 4ebc7ed commit d2c6c6b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions std/range/package.d
Expand Up @@ -4625,9 +4625,9 @@ body

/// Ditto
auto iota(B, E)(B begin, E end)
if (isFloatingPoint!(CommonType!(B, E)))
if (isFloatingPoint!(CommonType!(B, E)))
{
return iota(begin, end, 1.0);
return iota(begin, end, CommonType!(B, E)(1));
}

/// Ditto
Expand Down Expand Up @@ -4833,6 +4833,8 @@ unittest
import std.math : approxEqual, nextUp, nextDown;
import std.algorithm : count, equal;

static assert(is(ElementType!(typeof(iota(0f))) == float));

static assert(hasLength!(typeof(iota(0, 2))));
auto r = iota(0, 10, 1);
assert(r[$ - 1] == 9);
Expand Down

0 comments on commit d2c6c6b

Please sign in to comment.