Skip to content
Open
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
5 changes: 3 additions & 2 deletions src/processor/dataStack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,9 @@ function calculateStack(stackInfoList: StackInfo[]) {
stackStrategy === 'all' // single stack group
|| (stackStrategy === 'positive' && val > 0)
|| (stackStrategy === 'negative' && val < 0)
|| (stackStrategy === 'samesign' && sum >= 0 && val > 0) // All positive stack
|| (stackStrategy === 'samesign' && sum <= 0 && val < 0) // All negative stack
// For 'samesign', 0 is not stacked.
|| (stackStrategy === 'samesign' && sum > 0 && val > 0) // All positive stack
|| (stackStrategy === 'samesign' && sum < 0 && val < 0) // All negative stack
) {
// The sum has to be very small to be affected by the
// floating arithmetic problem. An incorrect result will probably
Expand Down
3 changes: 2 additions & 1 deletion test/ut/jest.config.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

102 changes: 102 additions & 0 deletions test/ut/spec/processor/dataStack.test.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.