Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(stack): remove stack only same sign #15211

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions src/processor/dataStack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,13 @@ function calculateStack(stackInfoList: StackInfo[]) {
const val = stackInfo.data.getByRawIndex(
stackInfo.stackResultDimension, stackedDataRawIndex
) as number;

// Considering positive stack, negative stack and empty data
if ((sum >= 0 && val > 0) // Positive stack
|| (sum <= 0 && val < 0) // Negative stack
) {
// The sum should be as less as possible to be effected
// by floating arithmetic problem. A wrong result probably
// filtered incorrectly by axis min/max.
sum = addSafe(sum, val);
stackedOver = val;
break;
}
// The sum should be as less as possible to be effected
// by floating arithmetic problem. A wrong result probably
// filtered incorrectly by axis min/max.
sum = addSafe(sum, val);
stackedOver = val;
break;
}
}

Expand Down
Loading