pow(0,0) does not throw ArithmeticException

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P2
    • None
    • Affects Version/s: 1.0.2
    • Component/s: core-libs
    • None
    • sparc
    • solaris_2.5.1



      Name: mc57594 Date: 01/30/97


      Documentation for java.lang.Math.pow(a, b) says that it throws an arithemtic exception for
      a <= 0 and b <= 0

      For pow(0, 0) it returns 1 instead. (This is OK, from a mathematical point of view,
      but is not according to the spec)
      This code should print "OK":

      public class p {
      public static void main (String[] av)
      {
      try
      {
      Math.pow(0.0, 0.0);
      } catch (ArithmeticException e)
      {
      System.out.println("OK");
      }
      }
      }


      company - Softway Pty Ltd , email - ###@###.###
      ======================================================================

            Assignee:
            Timothy Lindholm (Inactive)
            Reporter:
            Mark Chamness (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: