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

Math.max()/min() doesn't work correctly on Solaris

    Details

    • Subcomponent:
    • Resolved In Build:
      1.1beta3
    • CPU:
      sparc
    • OS:
      solaris_2.5.1
    • Verification:
      Not verified

      Description

       
      masayoshi.okutsu@Eng 1996-12-20
      Math.max(long,long) and .min(long,long) return an incorrect result with the
      following test program on Solaris. This works correctly on Win95.

      Source program:

      class max_min {
      public static void main (String args[]) {
      System.out.println("max") ;
      System.out.println(Math.max(-9223372036854775808L,9223372036854775807L));
      System.out.println("min") ;
      System.out.println(Math.min(-9223372036854775808L,9223372036854775807L));
      }
      }

      Result:

      JDK102% javac max_min.java
      JDK102% java max_min
      max
      9223372036854775807
      min
      -9223372036854775808

      jdk11% javac max_min.java
      jdk11% java max_min
      max
      -9223372036854775808
      min
      9223372036854775807

        Attachments

          Activity

            People

            • Assignee:
              pbk Peter Kessler
              Reporter:
              okutsu Masayoshi Okutsu
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: