BigDecimal.negate(MathContext) method rounds improperly in some cases

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 6
    • Affects Version/s: 5.0
    • Component/s: core-libs
    • None
    • b55
    • generic
    • generic

        The BigDecimal.negate(MathContext) method rounds improperly in some cases. It is implemented as

        plus(mc).negate()

        i.e. to rounds before negating. This gives the improper result if the rounding mode is asymetric with respect to sign, as round to +infinity and round to -infinity are.

              Assignee:
              Joe Darcy
              Reporter:
              Joe Darcy
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: