Misleading documentation in java.math.RoundingMode

XMLWordPrintable

    • Type: Bug
    • Resolution: Not an Issue
    • Priority: P4
    • None
    • Affects Version/s: None
    • Component/s: core-libs
    • None

      java.math.RoundingMode.HALF_UP announces that it is the rounding mode commonly taught in school. I believe this is a mistake since the commonly used rounding mode should be round to the nearest ties to positive infinity, which is the behaviour of Math.round. This comment is also presented in BigDecimal.ROUND_HALF_UP.

      Also, maybe we should have some more clarifications on the behaviours of round up and round down since normally the former means toward positive infinity and the opposite goes for the latter and Java seems to use these words with different meanings from their mathematical counterparts.

            Assignee:
            Raffaello Giulietti
            Reporter:
            Quan Anh Mai
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: