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

[Fmt-Nu] Doc: The spec for DecimalFormat.parse method is incomplete

XMLWordPrintable

    • Fix Understood
    • sparc
    • solaris_2.6



      Name: nkR10003 Date: 09/14/2001



      According to the specification, the parse method returns "the most economical"
      representation of the passed numeric string, in the form of either a long
      or a double. While in the parse method, if a multiplier has been set, the
      numeric representation of the string is divided by this multiplier. If the
      numeric representation is in the form of a long, the quotient is rounded
      towards zero. If the string is represented as a double, the quotient is
      rounded according to IEEE 754 round-to-nearest mode. The specification
      makes no mention of whether this division should take place with the string
      being represented as a long or a double.

      For example, one can pass a string representing Long.MIN_VALUE ("-9223372036854775808")
      to DecimalFormat.parse() method. If the DesimalFormat object is given with a
      multiplier of 100 the returned result will be undefined. If division takes place as
      a long, the result is -92233720368547758. If division takes place as a
      double, the result is -92233720368547760.

      Plese specify the correct behavior.

      ======================================================================

            naoto Naoto Sato
            knasunw Kna Kna (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: