From ff67cdc01b157e3a49871b3fbd726098c94137d9 Mon Sep 17 00:00:00 2001 From: houyusheng Date: Fri, 21 Oct 2022 22:12:21 +0800 Subject: [PATCH] fix(dataStack): zero is neither positive nor negative stack, close #17801 --- src/processor/dataStack.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/processor/dataStack.ts b/src/processor/dataStack.ts index 824e630594..fb08154262 100644 --- a/src/processor/dataStack.ts +++ b/src/processor/dataStack.ts @@ -131,8 +131,8 @@ 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 + || (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