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

Add Relational Operators to BigDecimal

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P3 P3
    • None
    • None
    • core-libs
    • None

      A DESCRIPTION OF THE REQUEST :
      Add gt (>), gte (>=), lt (<), lte (<=) methods to BigDecimal.

      JUSTIFICATION :
      It is hard to do without them if one is comparing the result of a computation to an error tolerance.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      if( BigDecimalX.lt( BigDecimalY ) )
          doThis();
      else
          doThat();
      ACTUAL -
      Can't be done now except with a lot of messing around.

      CUSTOMER SUBMITTED WORKAROUND :
      Emulate the desired behavior with absolute values and subtraction.

            darcy Joe Darcy
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: