You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "Luke Cwik (Jira)" <ji...@apache.org> on 2021/08/12 23:22:00 UTC

[jira] [Created] (BEAM-12755) Clean-up HistogramData to not throw errors during formatting

Luke Cwik created BEAM-12755:
--------------------------------

             Summary: Clean-up HistogramData to not throw errors during formatting
                 Key: BEAM-12755
                 URL: https://issues.apache.org/jira/browse/BEAM-12755
             Project: Beam
          Issue Type: Improvement
          Components: sdk-java-core
            Reporter: Luke Cwik
            Assignee: Luke Cwik


HistogramData throws an exception because DoubleMath.roundToInt throws an arithmetic exception when infinity is used.

Instead use String.format with %.0f formatting since it will appropriately format Inf, -Inf and NaN. It already used HALF_UP rounding as well as per the javadoc.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)