You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2021/05/22 06:45:21 UTC

[GitHub] [echarts] 100pah opened a new pull request #15015: fix:

100pah opened a new pull request #15015:
URL: https://github.com/apache/echarts/pull/15015


   (1) number getPrecisionSafe incorrect on scientific notation like 3.45e-1
   (2) stack sum eliminate floating arithmetic problem.
   
   <!-- Please fill in the following information to help us review your PR more efficiently. -->
   
   ## Brief Information
   
   This pull request is in the type of:
   
   - [x] bug fixing
   - [ ] new feature
   - [ ] others
   
   
   
   ### What does this PR do?
   
   fix: 
   + number getPrecisionSafe incorrect on scientific notation like 3.45e-1
   + stack sum eliminate floating arithmetic problem. 
   
   Fix #14668
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] pissang commented on a change in pull request #15015: Fix: (1) number getPrecisionSafe incorrect on scientific notation like 3.45e-1 (2) stack sum eliminate floating arithmetic problem.

Posted by GitBox <gi...@apache.org>.
pissang commented on a change in pull request #15015:
URL: https://github.com/apache/echarts/pull/15015#discussion_r637673179



##########
File path: src/util/number.ts
##########
@@ -268,6 +270,20 @@ export function getPercentWithPrecision(valueList: number[], idx: number, precis
     return seats[idx] / digits;
 }
 
+/**
+ * Solve the floating point adding problem like 0.1 + 0.2 === 0.30000000000000004
+ * See <http://0.30000000000000004.com/>
+ */
+export function addSafe(val0: number, val1: number): number {
+    const maxPrecision = Math.max(getPrecisionSafe(val0), getPrecisionSafe(val1));

Review comment:
       Can we use `ROUND_SUPPORTED_PRECISION_MAX` in the https://github.com/apache/echarts/blob/a46d2e668f98b17bbade2573b18aad4b4fb35530/src/util/number.ts#L164
   to avoid infinity loop? That method is much faster.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] echarts-bot[bot] commented on pull request #15015: fix:

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on pull request #15015:
URL: https://github.com/apache/echarts/pull/15015#issuecomment-846364120


   Thanks for your contribution!
   The community will review it ASAP. In the meanwhile, please checkout [the coding standard](https://echarts.apache.org/en/coding-standard.html) and Wiki about [How to make a pull request](https://github.com/apache/echarts/wiki/How-to-make-a-pull-request).
   
   The pull request is marked to be `PR: author is committer` because you are a committer of this project.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] 100pah merged pull request #15015: Fix: (1) number getPrecisionSafe incorrect on scientific notation like 3.45e-1 (2) stack sum eliminate floating arithmetic problem. (3) Should no dataZoom filtering when `toolbox.feature.dataZoom` not declared.

Posted by GitBox <gi...@apache.org>.
100pah merged pull request #15015:
URL: https://github.com/apache/echarts/pull/15015


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] echarts-bot[bot] commented on pull request #15015: Fix: (1) number getPrecisionSafe incorrect on scientific notation like 3.45e-1 (2) stack sum eliminate floating arithmetic problem. (3) Should no dataZoom filtering when `toolbox.feature.dataZoom` not declared.

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on pull request #15015:
URL: https://github.com/apache/echarts/pull/15015#issuecomment-851472938


   Congratulations! Your PR has been merged. Thanks for your contribution! 👍


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org