Skip to content

Commit

Permalink
add comment about int iterator for loop over k-1 obs
Browse files Browse the repository at this point in the history
  • Loading branch information
jangorecki committed Jan 11, 2024
1 parent 45904a7 commit 623f42b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/froll.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void frollmeanFast(double *x, uint64_t nx, ans_t *ans, int k, double fill, bool
long double w = 0.0; // sliding window aggregate
bool truehasna = hasna>0; // flag to re-run with NA support if NAs detected
if (!truehasna) {
int i; // iterator declared here because it is being used after for loop
int i; // iterator declared here because it is being used after for loop, it is int32 rather than int64 because first loop over k-1 observations cannot exceed int32 range
for (i=0; i<k-1; i++) { // loop over leading observation, all partial window only; #loop_counter_not_local_scope_ok
w += x[i]; // add current row to sliding window
ans->dbl_v[i] = fill; // answers are fill for partial window
Expand Down

0 comments on commit 623f42b

Please sign in to comment.