Skip to content

Stats.min is incorrect for ordered sliding windows? #12

@tvcutsem

Description

@tvcutsem

Given the following code using a fresh checkout of the repository on node v0.10.26:

var windows = eep.EventWorld.make().windows();
var win = windows.sliding(eep.Stats.min, 3);
win = windows.ordered(win);

win.on('emit', function(value) {
  console.log('min:' + value);
});

var values = [1,2,3,4,5,6];
for (var i in values) {
  win.enqueue(values[i]);
}

I get:

min:1
min:1
min:2
min:3

While I would have expected:

min:1
min:2
min:3
min:4

Replacing Stats.min by Stats.max I get the expected behavior, so I suspect there's an issue with Stats.min.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions