I'm checking this in.

This adds the two StrictMath.signum methods.
They can simply delegate to Math.signum, as the code would be
identical.

Tom

2006-03-15  Tom Tromey  <[EMAIL PROTECTED]>

        * java/lang/StrictMath.java (signum): New methods.

Index: java/lang/StrictMath.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/lang/StrictMath.java,v
retrieving revision 1.7
diff -u -r1.7 StrictMath.java
--- java/lang/StrictMath.java   7 Mar 2006 01:02:01 -0000       1.7
+++ java/lang/StrictMath.java   15 Mar 2006 21:56:38 -0000
@@ -1843,6 +1843,50 @@
   }
 
   /**
+   * <p>
+   * Returns the sign of the argument as follows:
+   * </p>
+   * <ul>
+   * <li>If <code>a</code> is greater than zero, the result is 1.0.</li>
+   * <li>If <code>a</code> is less than zero, the result is -1.0.</li>
+   * <li>If <code>a</code> is <code>NaN</code>, the result is <code>NaN</code>.
+   * <li>If <code>a</code> is positive or negative zero, the result is the
+   * same.</li>
+   * </ul>
+   * 
+   * @param a the numeric argument.
+   * @return the sign of the argument.
+   * @since 1.5.
+   */
+  public static double signum(double a)
+  {
+    // There's no difference.
+    return Math.signum(a);
+  }
+
+  /**
+   * <p>
+   * Returns the sign of the argument as follows:
+   * </p>
+   * <ul>
+   * <li>If <code>a</code> is greater than zero, the result is 1.0f.</li>
+   * <li>If <code>a</code> is less than zero, the result is -1.0f.</li>
+   * <li>If <code>a</code> is <code>NaN</code>, the result is <code>NaN</code>.
+   * <li>If <code>a</code> is positive or negative zero, the result is the
+   * same.</li>
+   * </ul>
+   * 
+   * @param a the numeric argument.
+   * @return the sign of the argument.
+   * @since 1.5.
+   */
+  public static float signum(float a)
+  {
+    // There's no difference.
+    return Math.signum(a);
+  }
+
+  /**
    * Return the ulp for the given double argument.  The ulp is the
    * difference between the argument and the next larger double.  Note
    * that the sign of the double argument is ignored, that is,

Reply via email to