Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
base: 256042b90d1f
Choose a base ref
...
head repository: jruby/jruby
compare: 7f9866b41251
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Sep 15, 2016

  1. Format initial string to specific precision, so rounding works.

    The logic in our double-based sprintf logic attempts to round
    values manually by inspecting a long-form version of the double.
    If we need to round, and the next digit is a five, it will round
    toward zero (truncate) iff that five is the last digit in the long
    unrounded string. This appears to have been an attempt to mimic
    C printf's behavior of rounding "true half" to even in the
    presence of inaccurately-represented IEEE754 decimals.
    
    This commit changes the pre-formatting to actually format with the
    specified precision, allowing NumberFormat's default HALF_EVEN
    logic to to the work for us.
    
    Fixes #4157.
    headius committed Sep 15, 2016
    Configuration menu
    Copy the full SHA
    6cef061 View commit details
    Browse the repository at this point in the history

Commits on Oct 12, 2016

  1. Merge pull request #4159 from headius/sprintf_rounding

    Format initial string to specific precision, so rounding works.
    enebo committed Oct 12, 2016
    Configuration menu
    Copy the full SHA
    7f9866b View commit details
    Browse the repository at this point in the history