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

jdk1.0.2, Float.toString produces incorrect results

XMLWordPrintable

    • 1.0fcs
    • generic
    • solaris_2.5.1
    • Not verified

      java.lang.Float.toString() method will truncate the string representation of the Float object and seems to produce inconsistent results.

      Small test case to use:

      public class FloatTest
      {
        public static void main (String[] args)
        {
          Float f1 = new Float (1234.123f);
          String str1 = f1.toString();
          System.out.println("f1 value is : " + str1);

          String str2 = Float.toString(12345.12345f);
          System.out.println("Float value of string is : " + str2);

        }

      }

            tlindholsunw Timothy Lindholm (Inactive)
            gvanassesunw Gunter Vanasse (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: