[ https://issues.apache.org/jira/browse/APEXMALHAR-2489?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16105370#comment-16105370 ]
ASF GitHub Bot commented on APEXMALHAR-2489: -------------------------------------------- florianschmidt1994 opened a new pull request #653: APEXMALHAR-2489 Change algorithm for running average URL: https://github.com/apache/apex-malhar/pull/653 The current algorithm for calculating the running average was subject to a potential overflow, because part of the formula required the average value (average) to be multiplied with the number of processed tuples (count). average * count would for example overflow when e.g. average > Double.MAX_VALUE and count >=2 This PR changes the formula used to the one described on http://www.heikohoffmann.de/htmlthesis/node134.html, where such a multiplication is not necessary anymore. It also adds a unit test which checks that there is not overflow occuring anymore ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Change algorithm for average calculation in RunningAverage > ---------------------------------------------------------- > > Key: APEXMALHAR-2489 > URL: https://issues.apache.org/jira/browse/APEXMALHAR-2489 > Project: Apache Apex Malhar > Issue Type: Improvement > Reporter: Vlad Rozov > Assignee: Florian Schmidt > Priority: Minor > > The algorithm for average calculation is the subject to overflow due to > (count * average). It may be better to use > http://www.heikohoffmann.de/htmlthesis/node134.html (with modification) to > compute the average. -- This message was sent by Atlassian JIRA (v6.4.14#64029)