Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-1087

NumberUtils#createNumber() returns positive BigDecimal when negative Float is expected

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.x
    • Fix Version/s: 3.4
    • Component/s: lang.math.*
    • Labels:
      None

      Description

      NumberUtils.createNumber("-0.0") returns BigDecimal with 0 signum.
      Caused by the implementation not checking for sign when extracting mantissa from the input string.

      Expected is that negative Float is returned.

        Attachments

        1. lang-1087-patch1.diff
          3 kB
          Renat Zhilkibaev

          Activity

            People

            • Assignee:
              britter Benedikt Ritter
              Reporter:
              renat Renat Zhilkibaev
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: