Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6325535

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 6
    • 5.0
    • 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.

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

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: