We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e7ae80c commit 1fbdc50Copy full SHA for 1fbdc50
source/mir/polynomial.d
@@ -46,12 +46,14 @@ struct Polynomial(F)
46
if (coefficients)
47
{
48
ptrdiff_t i = coefficients.length - 1;
49
+ assert(i >= 0);
50
auto c = cast()coefficients[i];
51
static foreach (d; Iota!derivative)
52
c *= i - d;
53
ret = cast(typeof(return)) c;
- while (--i >= derivative)
54
+ while (--i >= cast(ptrdiff_t)derivative)
55
56
+ assert(i < coefficients.length);
57
c = cast()coefficients[i];
58
59
0 commit comments