Copy harmony's jdk6 Math and StrictMath.

There's some ugliness here I want to remove, but it'll be less confusing if
I commit the upstream code first without my changes...

...that said, I've reverted the upstream Math.pow change because it it's just
cruft; we already pass their tests and jtreg's more thorough pow tests (see
http://blogs.sun.com/darcy/entry/finding_a_bug_in_fdlibm). My guess is that
their real problem was that they were using the buggy fdlibm 5.2 until after
they made the Math.pow change. We've always used 5.3, so we were fine.

Change-Id: I5a6c080d9fd6b60dc7bf77ac10096a913766f512
diff --git a/luni/src/main/java/java/lang/Math.java b/luni/src/main/java/java/lang/Math.java
index f7b49b2..8d0d781 100644
--- a/luni/src/main/java/java/lang/Math.java
+++ b/luni/src/main/java/java/lang/Math.java
@@ -22,7 +22,30 @@
  * functions, hyperbolic functions, exponential, logarithms, etc.
  */
 public final class Math {
+    private static final int FLOAT_EXPONENT_BIAS = 127;
 
+    private static final int FLOAT_EXPONENT_MASK = 0x7F800000;
+
+    private static final int DOUBLE_NON_MANTISSA_BITS = 12;
+
+    private static final int DOUBLE_MANTISSA_BITS = 52;
+
+    private static final int FLOAT_NON_MANTISSA_BITS = 9;
+
+    private static final int FLOAT_MANTISSA_BITS = 23;
+
+    private static final int DOUBLE_EXPONENT_BIAS = 1023;
+
+    private static final long DOUBLE_EXPONENT_MASK = 0x7ff0000000000000L;
+
+    private static final int FLOAT_MANTISSA_MASK = 0x007fffff;
+
+    private static final int FLOAT_SIGN_MASK = 0x80000000;
+
+    private static final long DOUBLE_MANTISSA_MASK = 0x000fffffffffffffL;
+
+    private static final long DOUBLE_SIGN_MASK = 0x8000000000000000L;
+    
     /**
      * The double value closest to e, the base of the natural logarithm.
      */
@@ -1050,4 +1073,377 @@
     private native static double nextafter(double x, double y);
 
     private native static float nextafterf(float x, float y);
+    
+    /**
+     * Answers a result of the magnitude of the first given double value and the
+     * sign of the second given double value.
+     * 
+     * @param magnitude
+     *            the double value whose magnitude should be used
+     * @param sign
+     *            the double value whose sign should be used
+     * @return a result of the magnitude of the first given double value and the
+     *         sign of the second given double value .
+     * 
+     * @since 1.6
+     */
+    public static double copySign(double magnitude, double sign) {
+        long mbits = Double.doubleToRawLongBits(magnitude);
+        long sbits = Double.doubleToRawLongBits(sign);
+        return Double.longBitsToDouble((mbits & ~DOUBLE_SIGN_MASK)
+                | (sbits & DOUBLE_SIGN_MASK));
+    }
+
+    /**
+     * Answers a result of the magnitude of the first given float value and the
+     * sign of the second given float value .
+     * 
+     * @param magnitude
+     *            the float value whose magnitude should be used
+     * @param sign
+     *            the float value whose sign should be used
+     * @return a result with the magnitude of the first given float value and
+     *         the sign of the second given float value .
+     * 
+     * @since 1.6
+     */
+    public static float copySign(float magnitude, float sign) {
+        int mbits = Float.floatToRawIntBits(magnitude);
+        int sbits = Float.floatToRawIntBits(sign);
+        return Float.intBitsToFloat((mbits & ~FLOAT_SIGN_MASK)
+                | (sbits & FLOAT_SIGN_MASK));
+    }
+    
+    /**
+     * Answers the exponent of a float.
+     * 
+     * @param f
+     *            the given float
+     * @return the exponent of the float.
+     * 
+     * @since 1.6
+     */
+    public static int getExponent(float f) {
+        int bits = Float.floatToRawIntBits(f);
+        bits = (bits & FLOAT_EXPONENT_MASK) >> FLOAT_MANTISSA_BITS;
+        return bits - FLOAT_EXPONENT_BIAS;
+    }
+
+    /**
+     * Answers the exponent of a double.
+     * 
+     * @param d
+     *            the given double
+     * @return the exponent of the double.
+     * 
+     * @since 1.6
+     */
+    public static int getExponent(double d) {
+        long bits = Double.doubleToRawLongBits(d);
+        bits = (bits & DOUBLE_EXPONENT_MASK) >> DOUBLE_MANTISSA_BITS;
+        return (int) bits - DOUBLE_EXPONENT_BIAS;
+    }    
+    
+    /**
+     * Answers a double next to the first given double value in the direction of
+     * the second given double.
+     * 
+     * @param start
+     *            the double value to start
+     * @param direction
+     *            the double indicating the direction
+     * @return a double next to the first given double value in the direction of
+     *         the second given double.
+     * 
+     * @since 1.6
+     */
+    public static double nextAfter(double start, double direction) {
+        if (0 == start && 0 == direction) {
+            return direction;
+        }
+        return nextafter(start, direction);
+    }
+
+    /**
+     * Answers a float next to the first given float value in the direction of
+     * the second given double value.
+     * 
+     * @param start
+     *            the float value to start
+     * @param direction
+     *            the double indicating the direction
+     * @return a float next to the first given float value in the direction of
+     *         the second given double.
+     * 
+     * @since 1.6
+     */
+    @SuppressWarnings("boxing")
+    public static float nextAfter(float start, double direction) {
+        if (Float.isNaN(start) || Double.isNaN(direction)) {
+            return Float.NaN;
+        }
+        if (0 == start && 0 == direction) {       	
+            return new Float(direction);
+        }
+        if ((start == Float.MIN_VALUE && direction < start)
+                || (start == -Float.MIN_VALUE && direction > start)) {
+            return (start > 0 ? 0f : -0f);
+        }
+        if (Float.isInfinite(start) && (direction != start)) {
+            return (start > 0 ? Float.MAX_VALUE : -Float.MAX_VALUE);
+        }
+        if ((start == Float.MAX_VALUE && direction > start)
+                || (start == -Float.MAX_VALUE && direction < start)) {
+            return (start > 0 ? Float.POSITIVE_INFINITY
+                    : Float.NEGATIVE_INFINITY);
+        }
+        if (direction > start) {
+            if (start > 0) {
+                return Float.intBitsToFloat(Float.floatToIntBits(start) + 1);
+            }
+            if (start < 0) {
+                return Float.intBitsToFloat(Float.floatToIntBits(start) - 1);
+            }
+            return +Float.MIN_VALUE;
+        }
+        if (direction < start) {
+            if (start > 0) {
+                return Float.intBitsToFloat(Float.floatToIntBits(start) - 1);
+            }
+            if (start < 0) {
+                return Float.intBitsToFloat(Float.floatToIntBits(start) + 1);
+            }
+            return -Float.MIN_VALUE;
+        }
+        return new Float(direction);
+    }
+    
+    /**
+     * Answers the next larger double value to d.
+     * 
+     * @param d
+     *            the double value to start
+     * @return the next larger double value of d.
+     * 
+     * @since 1.6
+     */
+    public static double nextUp(double d) {
+        if (Double.isNaN(d)) {
+            return Double.NaN;
+        }
+        if ((d == Double.POSITIVE_INFINITY)) {
+            return Double.POSITIVE_INFINITY;
+        }
+        if (0 == d) {
+            return Double.MIN_VALUE;
+        } else if (0 < d) {
+            return Double.longBitsToDouble(Double.doubleToLongBits(d) + 1);
+        } else {
+            return Double.longBitsToDouble(Double.doubleToLongBits(d) - 1);
+        }
+    }
+
+    /**
+     * Answers the next larger float value to d.
+     * 
+     * @param f
+     *            the float value to start
+     * @return the next larger float value of d.
+     * 
+     * @since 1.6
+     */
+    public static float nextUp(float f) {
+        if (Float.isNaN(f)) {
+            return Float.NaN;
+        }
+        if ((f == Float.POSITIVE_INFINITY)) {
+            return Float.POSITIVE_INFINITY;
+        }
+        if (0 == f) {
+            return Float.MIN_VALUE;
+        } else if (0 < f) {
+            return Float.intBitsToFloat(Float.floatToIntBits(f) + 1);
+        } else {
+            return Float.intBitsToFloat(Float.floatToIntBits(f) - 1);
+        }
+    }
+    
+    /**
+     * Answers a double value of d * 2^scaleFactor, the result may be rounded.
+     * 
+     * @param d
+     *            the base number
+     * @param scaleFactor
+     *            the power number
+     * @return d * 2^scaleFactor
+     * 
+     * @since 1.6
+     */
+    @SuppressWarnings("boxing")
+    public static double scalb(double d, int scaleFactor) {
+        if (Double.isNaN(d) || Double.isInfinite(d) || 0 == d) {
+            return d;
+        }
+        // change double to long for calculation
+        long bits = Double.doubleToLongBits(d);
+        // the sign of the results must be the same of given d
+        long sign = bits & DOUBLE_SIGN_MASK;
+        // calculates the factor of the result
+        long factor = ((bits & DOUBLE_EXPONENT_MASK) >> DOUBLE_MANTISSA_BITS)
+                - DOUBLE_EXPONENT_BIAS + scaleFactor;
+
+        // calcutes the factor of sub-normal values
+        int subNormalFactor = Long.numberOfLeadingZeros(bits
+                & ~DOUBLE_SIGN_MASK)
+                - DOUBLE_NON_MANTISSA_BITS;
+        if (subNormalFactor < 0) {
+            // not sub-normal values
+            subNormalFactor = 0;
+        } else {
+            factor = factor - subNormalFactor;
+        }
+        if (factor > Double.MAX_EXPONENT) {
+            return (d > 0 ? Double.POSITIVE_INFINITY : Double.NEGATIVE_INFINITY);
+        }
+
+        long result;
+        // if result is a sub-normal
+        if (factor <= -DOUBLE_EXPONENT_BIAS) {
+            // the number of digits that shifts
+            long digits = factor + DOUBLE_EXPONENT_BIAS + subNormalFactor;
+            if (Math.abs(d) < Double.MIN_NORMAL) {
+                // origin d is already sub-normal
+                result = shiftLongBits(bits & DOUBLE_MANTISSA_MASK, digits);
+            } else {
+                // origin d is not sub-normal, change mantissa to sub-normal
+                result = shiftLongBits(bits & DOUBLE_MANTISSA_MASK
+                        | 0x0010000000000000L, digits - 1);
+            }
+        } else {
+            if (Math.abs(d) >= Double.MIN_NORMAL) {
+                // common situation
+                result = ((factor + DOUBLE_EXPONENT_BIAS) << DOUBLE_MANTISSA_BITS)
+                        | (bits & DOUBLE_MANTISSA_MASK);
+            } else {
+                // origin d is sub-normal, change mantissa to normal style
+                result = ((factor + DOUBLE_EXPONENT_BIAS) << DOUBLE_MANTISSA_BITS)
+                        | ((bits << (subNormalFactor + 1)) & DOUBLE_MANTISSA_MASK);
+            }
+        }
+        return Double.longBitsToDouble(result | sign);
+    }
+
+    /**
+     * Answers a float value of d * 2^scaleFactor, the result may be rounded.
+     * 
+     * @param d
+     *            the base number
+     * @param scaleFactor
+     *            the power number
+     * @return d * 2^scaleFactor
+     * 
+     * @since 1.6
+     */
+    public static float scalb(float d, int scaleFactor) {
+        if (Float.isNaN(d) || Float.isInfinite(d) || 0 == d) {
+            return d;
+        }
+        int bits = Float.floatToIntBits(d);
+        int sign = bits & FLOAT_SIGN_MASK;
+        int factor = ((bits & FLOAT_EXPONENT_MASK) >> FLOAT_MANTISSA_BITS)
+                - FLOAT_EXPONENT_BIAS + scaleFactor;
+        // calcutes the factor of sub-normal values
+        int subNormalFactor = Integer.numberOfLeadingZeros(bits
+                & ~FLOAT_SIGN_MASK)
+                - FLOAT_NON_MANTISSA_BITS;
+        if (subNormalFactor < 0) {
+            // not sub-normal values
+            subNormalFactor = 0;
+        } else {
+            factor = factor - subNormalFactor;
+        }
+        if (factor > Float.MAX_EXPONENT) {
+            return (d > 0 ? Float.POSITIVE_INFINITY : Float.NEGATIVE_INFINITY);
+        }
+
+        int result;
+        // if result is a sub-normal
+        if (factor <= -FLOAT_EXPONENT_BIAS) {
+            // the number of digits that shifts
+            int digits = factor + FLOAT_EXPONENT_BIAS + subNormalFactor;
+            if (Math.abs(d) < Float.MIN_NORMAL) {
+                // origin d is already sub-normal
+                result = shiftIntBits(bits & FLOAT_MANTISSA_MASK, digits);
+            } else {
+                // origin d is not sub-normal, change mantissa to sub-normal
+                result = shiftIntBits(bits & FLOAT_MANTISSA_MASK | 0x00800000,
+                        digits - 1);
+            }
+        } else {
+            if (Math.abs(d) >= Float.MIN_NORMAL) {
+                // common situation
+                result = ((factor + FLOAT_EXPONENT_BIAS) << FLOAT_MANTISSA_BITS)
+                        | (bits & FLOAT_MANTISSA_MASK);
+            } else {
+                // origin d is sub-normal, change mantissa to normal style
+                result = ((factor + FLOAT_EXPONENT_BIAS) << FLOAT_MANTISSA_BITS)
+                        | ((bits << (subNormalFactor + 1)) & FLOAT_MANTISSA_MASK);
+            }
+        }
+        return Float.intBitsToFloat(result | sign);
+    }
+
+    // Shifts integer bits as float, if the digits is positive, left-shift; if
+    // not, shift to right and calculate its carry.
+    private static int shiftIntBits(int bits, int digits) {
+        if (digits > 0) {
+            return bits << digits;
+        }
+        // change it to positive
+        int absdigits = -digits;
+        if (!(Integer.numberOfLeadingZeros(bits & ~FLOAT_SIGN_MASK) <= (32 - absdigits))) {
+            return 0;
+        }
+        int ret = bits >> absdigits;
+        boolean halfbit = ((bits >> (absdigits - 1)) & 0x1) == 1;
+        if (halfbit) {
+            if (Integer.numberOfTrailingZeros(bits) < (absdigits - 1)) {
+                ret = ret + 1;
+            }
+            if (Integer.numberOfTrailingZeros(bits) == (absdigits - 1)) {
+                if ((ret & 0x1) == 1) {
+                    ret = ret + 1;
+                }
+            }
+        }
+        return ret;
+    }
+
+    // Shifts long bits as double, if the digits is positive, left-shift; if
+    // not, shift to right and calculate its carry.
+    private static long shiftLongBits(long bits, long digits) {
+        if (digits > 0) {
+            return bits << digits;
+        }
+        // change it to positive
+        long absdigits = -digits;
+        if (!(Long.numberOfLeadingZeros(bits & ~DOUBLE_SIGN_MASK) <= (64 - absdigits))) {
+            return 0;
+        }
+        long ret = bits >> absdigits;
+        boolean halfbit = ((bits >> (absdigits - 1)) & 0x1) == 1;
+        if (halfbit) {
+            // some bits will remain after shifting, calculates its carry
+            // subnormal
+            if (Long.numberOfTrailingZeros(bits) < (absdigits - 1)) {
+                ret = ret + 1;
+            }
+            if (Long.numberOfTrailingZeros(bits) == (absdigits - 1)) {
+                if ((ret & 0x1) == 1) {
+                    ret = ret + 1;
+                }
+            }
+        }
+        return ret;
+    }
 }
diff --git a/luni/src/main/java/java/lang/StrictMath.java b/luni/src/main/java/java/lang/StrictMath.java
index b375a0f..70a91aa 100644
--- a/luni/src/main/java/java/lang/StrictMath.java
+++ b/luni/src/main/java/java/lang/StrictMath.java
@@ -37,6 +37,29 @@
  * <a href="http://www.netlib.org/fdlibm/">http://www.netlib.org/fdlibm/</a>
  */
 public final class StrictMath {
+    private static final int FLOAT_EXPONENT_BIAS = 127;
+
+    private static final int FLOAT_EXPONENT_MASK = 0x7F800000;
+
+    private static final int DOUBLE_EXPONENT_BITS = 12;
+
+    private static final int DOUBLE_MANTISSA_BITS = 52;
+    
+    private static final int FLOAT_EXPONENT_BITS = 9;
+    
+    private static final int FLOAT_MANTISSA_BITS = 23;  
+
+    private static final int DOUBLE_EXPONENT_BIAS = 1023;
+
+    private static final long DOUBLE_EXPONENT_MASK = 0x7ff0000000000000L;
+
+    private static final int FLOAT_MANTISSA_MASK = 0x007fffff;
+
+    private static final int FLOAT_SIGN_MASK = 0x80000000;
+
+    private static final long DOUBLE_MANTISSA_MASK = 0x000fffffffffffffL;
+
+    private static final long DOUBLE_SIGN_MASK = 0x8000000000000000L;
 
     /**
      * The double value closest to e, the base of the natural logarithm.
@@ -1042,4 +1065,361 @@
     private native static double nextafter(double x, double y);
 
     private native static float nextafterf(float x, float y); 
+    
+    /**
+     * Answers a result of the magnitude of the first given double value and the
+     * sign of the seconde given double value.
+     * 
+     * @param magnitude
+     *            the double value whose magnitude should be used
+     * @param sign
+     *            the double value whose sign should be used
+     * @return a result of the magnitude of the first given double value and the
+     *         sign of the seconde given double value.
+     *         
+     * @since 1.6
+     */
+    public static double copySign(double magnitude, double sign) {
+        long mbits = Double.doubleToRawLongBits(magnitude);
+        long sbits = Double.doubleToLongBits(sign);
+        return Double.longBitsToDouble((mbits & ~DOUBLE_SIGN_MASK) | (sbits & DOUBLE_SIGN_MASK) );
+    }
+
+    /**
+     * Answers a result of the magnitude of the first given float value and the
+     * sign of the seconde given float value.
+     * 
+     * @param magnitude
+     *            the float value whose magnitude should be used
+     * @param sign
+     *            the float value whose sign should be used
+     * @return a result with the magnitude of the first given float value and
+     *         the sign of the seconde given float value.
+     *         
+     * @since 1.6
+     */
+    public static float copySign(float magnitude, float sign) {
+        int mbits = Float.floatToRawIntBits(magnitude);
+        int sbits = Float.floatToIntBits(sign);
+        return Float.intBitsToFloat((mbits & ~FLOAT_SIGN_MASK)| (sbits & FLOAT_SIGN_MASK) );
+    }
+    
+    /**
+     * Answers the exponent of a float.
+     * 
+     * @param f
+     *            the given float
+     * @return the exponent of the float.
+     * 
+     * @since 1.6
+     */
+    public static int getExponent(float f){
+    	int bits = Float.floatToRawIntBits(f);
+        bits = (bits & FLOAT_EXPONENT_MASK) >> FLOAT_MANTISSA_BITS;
+        return bits - FLOAT_EXPONENT_BIAS;
+    }
+    
+    /**
+     * Answers the exponent of a double.
+     * 
+     * @param d
+     *            the given double
+     * @return the exponent of the double.
+     * 
+     * @since 1.6
+     */
+    public static int getExponent(double d){
+    	long bits = Double.doubleToRawLongBits(d);
+        bits = (bits & DOUBLE_EXPONENT_MASK) >> DOUBLE_MANTISSA_BITS;
+        return (int) bits - DOUBLE_EXPONENT_BIAS;
+    }
+    
+    /**
+     * Answers a double next to the first given double value in the direction of
+     * the second given double.
+     * 
+     * @param start
+     *            the double value to start
+     * @param direction
+     *            the double indicating the direction
+     * @return a double next to the first given double value in the direction of
+     *         the second given double.
+     *         
+     * @since 1.6
+     */
+    public static double nextAfter(double start, double direction) {
+        if (0 == start && 0 == direction) {
+            return direction;
+        }
+        return nextafter(start, direction);
+    }
+
+    /**
+     * Answers a float next to the first given float value in the direction of
+     * the second given double value.
+     * 
+     * @param start
+     *            the float value to start
+     * @param direction
+     *            the double indicating the direction
+     * @return a float next to the first given float value in the direction of
+     *         the second given double.
+     *         
+     * @since 1.6
+     */
+    @SuppressWarnings("boxing")
+    public static float nextAfter(float start, double direction) {
+        if (Float.isNaN(start) || Double.isNaN(direction)) {
+            return Float.NaN;
+        }
+        if (0 == start && 0 == direction) {
+            return new Float(direction);
+        }
+        if ((start == Float.MIN_VALUE && direction < start)
+                || (start == -Float.MIN_VALUE && direction > start)) {
+            return (start > 0 ? 0f : -0f);
+        }
+        if (Float.isInfinite(start) && (direction != start)) {
+            return (start > 0 ? Float.MAX_VALUE : -Float.MAX_VALUE);
+        }
+        if ((start == Float.MAX_VALUE && direction > start)
+                || (start == -Float.MAX_VALUE && direction < start)) {
+            return (start > 0 ? Float.POSITIVE_INFINITY
+                    : Float.NEGATIVE_INFINITY);
+        }
+        if (direction > start) {
+            if (start > 0) {
+                return Float.intBitsToFloat(Float.floatToIntBits(start) + 1);
+            }
+            if (start < 0) {
+                return Float.intBitsToFloat(Float.floatToIntBits(start) - 1);
+            }
+            return +Float.MIN_VALUE;
+        }
+        if (direction < start) {
+            if (start > 0) {
+                return Float.intBitsToFloat(Float.floatToIntBits(start) - 1);
+            }
+            if (start < 0) {
+                return Float.intBitsToFloat(Float.floatToIntBits(start) + 1);
+            }
+            return -Float.MIN_VALUE;
+        }
+        return Double.valueOf(direction).floatValue();
+    }
+
+    /**
+     * Answers the next larger double value to d.
+     * 
+     * @param d
+     *            the double value to start
+     * @return the next larger double value of d.
+     * 
+     * @since 1.6
+     */
+    public static double nextUp(double d) {
+        if (Double.isNaN(d)) {
+            return Double.NaN;
+        }
+        if ((d == Double.POSITIVE_INFINITY)) {
+            return Double.POSITIVE_INFINITY;
+        }
+        if (0 == d) {
+            return Double.MIN_VALUE;
+        } else if (0 < d) {
+            return Double.longBitsToDouble(Double.doubleToLongBits(d) + 1);
+        } else {
+            return Double.longBitsToDouble(Double.doubleToLongBits(d) - 1);
+        }
+    }
+    
+    /**
+     * Answers the next larger float value to d.
+     * 
+     * @param f
+     *            the float value to start
+     * @return the next larger float value of d.
+     * 
+     * @since 1.6
+     */
+    public static float nextUp(float f) {
+        if (Float.isNaN(f)) {
+            return Float.NaN;
+        }
+        if ((f == Float.POSITIVE_INFINITY)) {
+            return Float.POSITIVE_INFINITY;
+        }
+        if (0 == f) {
+            return Float.MIN_VALUE;
+        } else if (0 < f) {
+            return Float.intBitsToFloat(Float.floatToIntBits(f) + 1);
+        } else {
+            return Float.intBitsToFloat(Float.floatToIntBits(f) - 1);
+        }
+    }
+    
+    /**
+     * Answers a double value of d 2^scaleFactor, the result may be rounded.
+     * 
+     * @param d
+     *            the base number
+     * @param scaleFactor
+     *            the power number
+     * @return d 2^scaleFactor
+     * 
+     * @since 1.6
+     */
+    @SuppressWarnings("boxing")
+    public static double scalb(double d, int scaleFactor) {
+        if (Double.isNaN(d) || Double.isInfinite(d) || 0 == d) {
+            return d;
+        }
+        // change double to long for calculation
+        long bits = Double.doubleToLongBits(d);
+        // the sign of the results must be the same of given d
+        Long sign = bits & DOUBLE_SIGN_MASK;
+        // calculates the factor of the result
+        long factor = (int) ((Double.doubleToLongBits(d) & DOUBLE_EXPONENT_MASK) >> DOUBLE_MANTISSA_BITS)
+                - DOUBLE_EXPONENT_BIAS + scaleFactor;
+
+        // calcutes the factor of sub-normal values
+        int subNormalFactor = Long.numberOfLeadingZeros(bits
+                & ~DOUBLE_SIGN_MASK)
+                - DOUBLE_EXPONENT_BITS;
+        if (subNormalFactor < 0) {
+            // not sub-normal values
+            subNormalFactor = 0;
+        }
+        if (Math.abs(d) < Double.MIN_NORMAL) {
+            factor = factor - subNormalFactor;
+        }
+        if (factor > Double.MAX_EXPONENT) {
+            return (d > 0 ? Double.POSITIVE_INFINITY : Double.NEGATIVE_INFINITY);
+        }
+
+        long result;
+        // if result is a sub-normal
+        if (factor < -DOUBLE_EXPONENT_BIAS) {
+            // the number of digits that shifts
+            long digits = factor + DOUBLE_EXPONENT_BIAS + subNormalFactor;
+            if (Math.abs(d) < Double.MIN_NORMAL) {
+                // origin d is already sub-normal
+                result = shiftLongBits(bits & DOUBLE_MANTISSA_MASK, digits);
+            } else {
+                // origin d is not sub-normal, change mantissa to sub-normal
+                result = shiftLongBits(bits & DOUBLE_MANTISSA_MASK
+                        | 0x0010000000000000L, digits - 1);
+            }
+        } else {
+            if (Math.abs(d) >= Double.MIN_NORMAL) {
+                // common situation
+                result = ((factor + DOUBLE_EXPONENT_BIAS) << DOUBLE_MANTISSA_BITS)
+                        | (bits & DOUBLE_MANTISSA_MASK);
+            } else {
+                // origin d is sub-normal, change mantissa to normal style
+                result = ((factor + DOUBLE_EXPONENT_BIAS) << DOUBLE_MANTISSA_BITS)
+                        | ((bits << (subNormalFactor + 1)) & DOUBLE_MANTISSA_MASK);
+            }
+        }
+        return Double.longBitsToDouble(result | sign);
+    }
+
+    /**
+     * Answers a float value of d 2^scaleFactor, the result may be rounded.
+     * 
+     * @param d
+     *            the base number
+     * @param scaleFactor
+     *            the power number
+     * @return d 2^scaleFactor
+     * 
+     * @since 1.6
+     */
+    public static float scalb(float d, int scaleFactor) {
+        if (Float.isNaN(d) || Float.isInfinite(d) || 0 == d) {
+            return d;
+        }
+        int bits = Float.floatToIntBits(d);
+        int sign = bits & FLOAT_SIGN_MASK;
+        int factor = ((Float.floatToIntBits(d) & FLOAT_EXPONENT_MASK) >> FLOAT_MANTISSA_BITS)
+                - FLOAT_EXPONENT_BIAS + scaleFactor;
+        // calcutes the factor of sub-normal values
+        int subNormalFactor = Integer.numberOfLeadingZeros(bits
+                & ~FLOAT_SIGN_MASK)
+                - FLOAT_EXPONENT_BITS;
+        if (subNormalFactor < 0) {
+            // not sub-normal values
+            subNormalFactor = 0;
+        }
+        if (Math.abs(d) < Float.MIN_NORMAL) {
+            factor = factor - subNormalFactor;
+        }
+        if (factor > Float.MAX_EXPONENT) {
+            return (d > 0 ? Float.POSITIVE_INFINITY : Float.NEGATIVE_INFINITY);
+        }
+
+        int result;
+        // if result is a sub-normal
+        if (factor < -FLOAT_EXPONENT_BIAS) {
+            // the number of digits that shifts
+            int digits = factor + FLOAT_EXPONENT_BIAS + subNormalFactor;
+            if (Math.abs(d) < Float.MIN_NORMAL) {
+                // origin d is already sub-normal
+                result = shiftIntBits(bits & FLOAT_MANTISSA_MASK, digits);
+            } else {
+                // origin d is not sub-normal, change mantissa to sub-normal
+                result = shiftIntBits(bits & FLOAT_MANTISSA_MASK | 0x00800000,
+                        digits - 1);
+            }
+        } else {
+            if (Math.abs(d) >= Float.MIN_NORMAL) {
+                // common situation
+                result = ((factor + FLOAT_EXPONENT_BIAS) << FLOAT_MANTISSA_BITS)
+                        | (bits & FLOAT_MANTISSA_MASK);
+            } else {
+                // origin d is sub-normal, change mantissa to normal style
+                result = ((factor + FLOAT_EXPONENT_BIAS) << FLOAT_MANTISSA_BITS)
+                        | ((bits << (subNormalFactor + 1)) & FLOAT_MANTISSA_MASK);
+            }
+        }
+        return Float.intBitsToFloat(result | sign);
+    }
+
+    // Shifts integer bits as float, if the digits is positive, left-shift; if
+    // not, shift to right and calculate its carry.
+    private static int shiftIntBits(int bits, int digits) {
+        if (digits > 0) {
+            return bits << digits;
+        }
+        // change it to positive
+        int absdigits = -digits;
+        if (Integer.numberOfLeadingZeros(bits & ~FLOAT_SIGN_MASK) <= (32 - absdigits)) {
+            // some bits will remain after shifting, calculates its carry
+            if ((((bits >> (absdigits - 1)) & 0x1) == 0)
+                    || Integer.numberOfTrailingZeros(bits) == (absdigits - 1)) {
+                return bits >> absdigits;
+            }
+            return ((bits >> absdigits) + 1);
+        }
+        return 0;
+    }
+
+    // Shifts long bits as double, if the digits is positive, left-shift; if
+    // not, shift to right and calculate its carry.
+    private static long shiftLongBits(long bits, long digits) {
+        if (digits > 0) {
+            return bits << digits;
+        }
+        // change it to positive
+        long absdigits = -digits;
+        if (Long.numberOfLeadingZeros(bits & ~DOUBLE_SIGN_MASK) <= (64 - absdigits)) {
+            // some bits will remain after shifting, calculates its carry
+            if ((((bits >> (absdigits - 1)) & 0x1) == 0)
+                    || Long.numberOfTrailingZeros(bits) == (absdigits - 1)) {
+                return bits >> absdigits;
+            }
+            return ((bits >> absdigits) + 1);
+        }
+        return 0;
+    }
 }
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/MathTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/MathTest.java
index 02bed3c..4ff0a09 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/MathTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/MathTest.java
@@ -17,247 +17,107 @@
 
 package org.apache.harmony.luni.tests.java.lang;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
-@TestTargetClass(Math.class) 
 public class MathTest extends junit.framework.TestCase {
 
-    double HYP = Math.sqrt(2.0);
+	double HYP = Math.sqrt(2.0);
 
-    double OPP = 1.0;
+	double OPP = 1.0;
 
-    double ADJ = 1.0;
+	double ADJ = 1.0;
 
-    /* Required to make previous preprocessor flags work - do not remove */
-    int unused = 0;
+	/* Required to make previous preprocessor flags work - do not remove */
+	int unused = 0;
 
-    public static void assertEquals(String message, double expected, double actual, double delta) {
-        if (delta == 0D)
-            junit.framework.Assert.assertEquals(message, expected, actual, Math.ulp(expected));
-        else
-            junit.framework.Assert.assertEquals(message, expected, actual, delta);
-    }
+	/**
+	 * @tests java.lang.Math#abs(double)
+	 */
+	public void test_absD() {
+		// Test for method double java.lang.Math.abs(double)
 
-    public static void assertEquals(String message, float expected, float actual, float delta) {
-        if (delta == 0F)
-            junit.framework.Assert.assertEquals(message, expected, actual, Math.ulp(expected));
-        else
-            junit.framework.Assert.assertEquals(message, expected, actual, delta);
-    }
-    
-    /**
-     * @tests java.lang.Math#abs(double)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "abs",
-        args = {double.class}
-    )
-    public void test_absD() {
-        // Test for method double java.lang.Math.abs(double)
-        assertTrue("Incorrect double abs value",
-                (Math.abs(-1908.8976) == 1908.8976));
-        assertTrue("Incorrect double abs value",
-                (Math.abs(1908.8976) == 1908.8976));
-        assertEquals(0.0, Math.abs(0.0));
-        assertEquals(0.0, Math.abs(-0.0));
-        assertEquals(Double.POSITIVE_INFINITY, 
-                                            Math.abs(Double.POSITIVE_INFINITY));
-        assertEquals(Double.POSITIVE_INFINITY, 
-                                            Math.abs(Double.NEGATIVE_INFINITY));
-        
-        assertEquals(Double.NaN, Math.abs(Double.NaN));        
-    }
+		assertTrue("Incorrect double abs value",
+				(Math.abs(-1908.8976) == 1908.8976));
+		assertTrue("Incorrect double abs value",
+				(Math.abs(1908.8976) == 1908.8976));
+	}
 
-    /**
-     * @tests java.lang.Math#abs(float)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "abs",
-        args = {float.class}
-    )
-    public void test_absF() {
-        // Test for method float java.lang.Math.abs(float)
-        assertTrue("Incorrect float abs value",
-                (Math.abs(-1908.8976f) == 1908.8976f));
-        assertTrue("Incorrect float abs value",
-                (Math.abs(1908.8976f) == 1908.8976f));
-        
-        assertEquals(0.0f, Math.abs(0.0f));
-        assertEquals(0.0f, Math.abs(-0.0f));
-        assertEquals(Float.POSITIVE_INFINITY, 
-                                            Math.abs(Float.POSITIVE_INFINITY));
-        assertEquals(Float.POSITIVE_INFINITY, 
-                                            Math.abs(Float.NEGATIVE_INFINITY));
-        
-        assertEquals(Float.NaN, Math.abs(Float.NaN));
-    }
+	/**
+	 * @tests java.lang.Math#abs(float)
+	 */
+	public void test_absF() {
+		// Test for method float java.lang.Math.abs(float)
+		assertTrue("Incorrect float abs value",
+				(Math.abs(-1908.8976f) == 1908.8976f));
+		assertTrue("Incorrect float abs value",
+				(Math.abs(1908.8976f) == 1908.8976f));
+	}
 
-    /**
-     * @tests java.lang.Math#abs(int)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "abs",
-        args = {int.class}
-    )
-    public void test_absI() {
-        // Test for method int java.lang.Math.abs(int)
-        assertTrue("Incorrect int abs value", (Math.abs(-1908897) == 1908897));
-        assertTrue("Incorrect int abs value", (Math.abs(1908897) == 1908897));
-        
-        assertEquals(Integer.MIN_VALUE, Math.abs(Integer.MIN_VALUE));
-    }
+	/**
+	 * @tests java.lang.Math#abs(int)
+	 */
+	public void test_absI() {
+		// Test for method int java.lang.Math.abs(int)
+		assertTrue("Incorrect int abs value", (Math.abs(-1908897) == 1908897));
+		assertTrue("Incorrect int abs value", (Math.abs(1908897) == 1908897));
+	}
 
-    /**
-     * @tests java.lang.Math#abs(long)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "abs",
-        args = {long.class}
-    )
-    public void test_absJ() {
-        // Test for method long java.lang.Math.abs(long)
-        assertTrue("Incorrect long abs value",
-                (Math.abs(-19088976000089L) == 19088976000089L));
-        assertTrue("Incorrect long abs value",
-                (Math.abs(19088976000089L) == 19088976000089L));
-        
-        assertEquals(Long.MIN_VALUE, Math.abs(Long.MIN_VALUE));        
-    }
+	/**
+	 * @tests java.lang.Math#abs(long)
+	 */
+	public void test_absJ() {
+		// Test for method long java.lang.Math.abs(long)
+		assertTrue("Incorrect long abs value",
+				(Math.abs(-19088976000089L) == 19088976000089L));
+		assertTrue("Incorrect long abs value",
+				(Math.abs(19088976000089L) == 19088976000089L));
+	}
 
-    /**
-     * @tests java.lang.Math#acos(double)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "acos",
-        args = {double.class}
-    )
-    public void test_acosD() {
-        // Test for method double java.lang.Math.acos(double)
-        double r = Math.cos(Math.acos(ADJ / HYP));
-        long lr = Double.doubleToLongBits(r);
-        long t = Double.doubleToLongBits(ADJ / HYP);
-        assertTrue("Returned incorrect arc cosine", lr == t || (lr + 1) == t
-                || (lr - 1) == t);
-        
-        assertEquals(Double.NaN, Math.acos(Double.MAX_VALUE));
-        assertEquals(Double.NaN, Math.acos(Double.NaN));
-    }
+	/**
+	 * @tests java.lang.Math#acos(double)
+	 */
+	public void test_acosD() {
+		// Test for method double java.lang.Math.acos(double)
+		double r = Math.cos(Math.acos(ADJ / HYP));
+		long lr = Double.doubleToLongBits(r);
+		long t = Double.doubleToLongBits(ADJ / HYP);
+		assertTrue("Returned incorrect arc cosine", lr == t || (lr + 1) == t
+				|| (lr - 1) == t);
+	}
 
-    /**
-     * @tests java.lang.Math#asin(double)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "asin",
-        args = {double.class}
-    )
-    public void test_asinD() {
-        // Test for method double java.lang.Math.asin(double)
-        double r = Math.sin(Math.asin(OPP / HYP));
-        long lr = Double.doubleToLongBits(r);
-        long t = Double.doubleToLongBits(OPP / HYP);
-        assertTrue("Returned incorrect arc sine", lr == t || (lr + 1) == t
-                || (lr - 1) == t);
-        
-        assertEquals(Double.NaN, Math.asin(Double.MAX_VALUE));
-        assertEquals(Double.NaN, Math.asin(Double.NaN));
-        assertEquals(0, Math.asin(0), 0);
-        assertEquals(-0, Math.asin(-0), 0);        
-    }
+	/**
+	 * @tests java.lang.Math#asin(double)
+	 */
+	public void test_asinD() {
+		// Test for method double java.lang.Math.asin(double)
+		double r = Math.sin(Math.asin(OPP / HYP));
+		long lr = Double.doubleToLongBits(r);
+		long t = Double.doubleToLongBits(OPP / HYP);
+		assertTrue("Returned incorrect arc sine", lr == t || (lr + 1) == t
+				|| (lr - 1) == t);
+	}
 
-    /**
-     * @tests java.lang.Math#atan(double)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "atan",
-        args = {double.class}
-    )
-    public void test_atanD() {
-        // Test for method double java.lang.Math.atan(double)
-        double answer = Math.tan(Math.atan(1.0));
-        assertTrue("Returned incorrect arc tangent: " + answer, answer <= 1.0
-                && answer >= 9.9999999999999983E-1);
-        
-        assertEquals(Double.NaN, Math.atan(Double.NaN));
-        assertEquals(0.0, Math.atan(0.0), 0.0);
-        assertEquals(-0.0, Math.atan(-0.0), 0.0);
-    }
+	/**
+	 * @tests java.lang.Math#atan(double)
+	 */
+	public void test_atanD() {
+		// Test for method double java.lang.Math.atan(double)
+		double answer = Math.tan(Math.atan(1.0));
+		assertTrue("Returned incorrect arc tangent: " + answer, answer <= 1.0
+				&& answer >= 9.9999999999999983E-1);
+	}
 
-    /**
-     * @tests java.lang.Math#atan2(double, double)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "atan2",
-        args = {double.class, double.class}
-    )
-    public void test_atan2DD() {
-        double pi = 3.141592653589793;
-        // Test for method double java.lang.Math.atan2(double, double)
-        double answer = Math.atan(Math.tan(1.0));
-        assertTrue("Returned incorrect arc tangent: " + answer, answer <= 1.0
-                && answer >= 9.9999999999999983E-1);
-        
-        assertEquals(Double.NaN, Math.atan2(Double.NaN, 1.0));
-        assertEquals(Double.NaN, Math.atan2(1.0, Double.NaN));
-        
-        assertEquals(0.0, Math.atan2(0, 1));
-        assertEquals(0.0, Math.atan2(1, Double.POSITIVE_INFINITY));
-        
-        assertEquals(-0.0, Math.atan2(-0.0, 1.0));
-        assertEquals(-0.0, Math.atan2(-1.0, Double.POSITIVE_INFINITY));
-        
-        assertEquals(pi, Math.atan2(0.0, -1.0));
-        assertEquals(pi, Math.atan2(1.0, Double.NEGATIVE_INFINITY));       
-        
-        assertEquals(-pi, Math.atan2(-0.0, -1.0));
-        assertEquals(-pi, Math.atan2(-1.0, Double.NEGATIVE_INFINITY)); 
-        
-        assertEquals(pi/2, Math.atan2(1.0, 0.0));
-        assertEquals(pi/2, Math.atan2(1.0, -0.0));
-        
-        assertEquals(pi/2, Math.atan2(Double.POSITIVE_INFINITY, 1));
-        assertEquals(pi/2, Math.atan2(Double.POSITIVE_INFINITY, -1));     
-        
-        assertEquals(-pi/2, Math.atan2(-1, 0));
-        assertEquals(-pi/2, Math.atan2(-1, -0));        
-        assertEquals(-pi/2, Math.atan2(Double.NEGATIVE_INFINITY, 1)); 
-        
-        assertEquals(pi/4, Math.atan2(Double.POSITIVE_INFINITY, 
-                                                     Double.POSITIVE_INFINITY));
-        assertEquals(3*pi/4, Math.atan2(Double.POSITIVE_INFINITY, 
-                                                     Double.NEGATIVE_INFINITY));    
-        assertEquals(-pi/4, Math.atan2(Double.NEGATIVE_INFINITY, 
-                                                     Double.POSITIVE_INFINITY)); 
-        assertEquals(-3*pi/4, Math.atan2(Double.NEGATIVE_INFINITY, 
-                                                     Double.NEGATIVE_INFINITY));        
-    }
+	/**
+	 * @tests java.lang.Math#atan2(double, double)
+	 */
+	public void test_atan2DD() {
+		// Test for method double java.lang.Math.atan2(double, double)
+		double answer = Math.atan(Math.tan(1.0));
+		assertTrue("Returned incorrect arc tangent: " + answer, answer <= 1.0
+				&& answer >= 9.9999999999999983E-1);
+	}
     
      /**
      * @tests java.lang.Math#cbrt(double)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "cbrt",
-        args = {double.class}
-    )
     public void test_cbrt_D() {
         //Test for special situations
         assertTrue("Should return Double.NaN", Double.isNaN(Math
@@ -269,11 +129,11 @@
                 Double.NEGATIVE_INFINITY, Math
                         .cbrt(Double.NEGATIVE_INFINITY), 0D);
         assertEquals(Double.doubleToLongBits(0.0), Double.doubleToLongBits(Math
-                .cbrt(0.0)));
-        assertEquals(Double.doubleToLongBits(+0.0), Double.doubleToLongBits(Math
-                .cbrt(+0.0)));
-        assertEquals(Double.doubleToLongBits(-0.0), Double.doubleToLongBits(Math
-                .cbrt(-0.0)));
+				.cbrt(0.0)));
+		assertEquals(Double.doubleToLongBits(+0.0), Double.doubleToLongBits(Math
+				.cbrt(+0.0)));
+		assertEquals(Double.doubleToLongBits(-0.0), Double.doubleToLongBits(Math
+				.cbrt(-0.0)));
 
         assertEquals("Should return 3.0", 3.0, Math.cbrt(27.0), 0D);
         assertEquals("Should return 23.111993172558684", 23.111993172558684,
@@ -290,62 +150,173 @@
         assertEquals("Should return -0.01", -0.01, Math.cbrt(-0.000001), 0D);
     }
 
-    /**
-     * @tests java.lang.Math#ceil(double)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "ceil",
-        args = {double.class}
-    )
-    public void test_ceilD() {
-        // Test for method double java.lang.Math.ceil(double)
+	/**
+	 * @tests java.lang.Math#ceil(double)
+	 */
+	public void test_ceilD() {
+		// Test for method double java.lang.Math.ceil(double)
                 assertEquals("Incorrect ceiling for double",
                              79, Math.ceil(78.89), 0);
-        assertEquals("Incorrect ceiling for double",
+		assertEquals("Incorrect ceiling for double",
                              -78, Math.ceil(-78.89), 0);
-        
-        assertEquals("Incorrect ceiling for double",
-                -78, Math.ceil(-78), 0);
-        
-        double [] args = {0.0, -0.0, Double.NaN, Double.POSITIVE_INFINITY, 
-                Double.NEGATIVE_INFINITY};
-        for(int i = 0; i < args.length; i++) {
-            assertEquals(args[i], Math.ceil(args[i]));
+	}
+	
+	/**
+     * cases for test_copySign_DD in MathTest/StrictMathTest
+     */
+    static final double[] COPYSIGN_DD_CASES = new double[] {
+            Double.POSITIVE_INFINITY, Double.MAX_VALUE, 3.4E302, 2.3,
+            Double.MIN_NORMAL, Double.MIN_NORMAL / 2, Double.MIN_VALUE, +0.0,
+            0.0, -0.0, -Double.MIN_VALUE, -Double.MIN_NORMAL / 2,
+            -Double.MIN_NORMAL, -4.5, -3.4E102, -Double.MAX_VALUE,
+            Double.NEGATIVE_INFINITY };
+
+    /**
+     * @tests {@link java.lang.Math#copySign(double, double)}
+     * @since 1.6
+     * 
+     */
+    @SuppressWarnings("boxing")
+    public void test_copySign_DD() {
+        for (int i = 0; i < COPYSIGN_DD_CASES.length; i++) {
+            final double magnitude = COPYSIGN_DD_CASES[i];
+            final long absMagnitudeBits = Double.doubleToLongBits(Math
+                    .abs(magnitude));
+            final long negMagnitudeBits = Double.doubleToLongBits(-Math
+                    .abs(magnitude));
+
+            // cases for NaN
+            assertEquals("If the sign is NaN, the result should be positive.",
+                    absMagnitudeBits, Double.doubleToLongBits(Math.copySign(
+                            magnitude, Double.NaN)));
+            assertTrue("The result should be NaN.", Double.isNaN(Math.copySign(
+                    Double.NaN, magnitude)));
+
+            for (int j = 0; j < COPYSIGN_DD_CASES.length; j++) {
+                final double sign = COPYSIGN_DD_CASES[j];
+                final long resultBits = Double.doubleToLongBits(Math.copySign(
+                        magnitude, sign));
+
+                if (sign > 0 || Double.valueOf(+0.0).equals(sign)
+                        || Double.valueOf(0.0).equals(sign)) {
+                    assertEquals(
+                            "If the sign is positive, the result should be positive.",
+                            absMagnitudeBits, resultBits);
+                }
+                if (sign < 0 || Double.valueOf(-0.0).equals(sign)) {
+                    assertEquals(
+                            "If the sign is negative, the result should be negative.",
+                            negMagnitudeBits, resultBits);
+                }
+            }
         }
-        assertEquals(-0.0, Math.ceil(-0.5));
+
+        assertTrue("The result should be NaN.", Double.isNaN(Math.copySign(
+                Double.NaN, Double.NaN)));
+
+        try {
+            Math.copySign((Double) null, 2.3);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
+        try {
+            Math.copySign(2.3, (Double) null);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
+        try {
+            Math.copySign((Double) null, (Double) null);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
     }
 
     /**
-     * @tests java.lang.Math#cos(double)
+     * cases for test_copySign_FF in MathTest/StrictMathTest
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "cos",
-        args = {double.class}
-    )
-    public void test_cosD() {
-        // Test for method double java.lang.Math.cos(double)
-        assertEquals("Incorrect answer", 1.0, Math.cos(0), 0D);
-        assertEquals("Incorrect answer", 0.5403023058681398, Math.cos(1), 0D);
-        double [] args = {Double.NaN, Double.POSITIVE_INFINITY, 
-                          Double.NEGATIVE_INFINITY};
-        for(int i = 0; i < args.length; i++) {
-            assertEquals(args[i], Math.ceil(args[i]));
-        }        
+    static final float[] COPYSIGN_FF_CASES = new float[] {
+            Float.POSITIVE_INFINITY, Float.MAX_VALUE, 3.4E12f, 2.3f,
+            Float.MIN_NORMAL, Float.MIN_NORMAL / 2, Float.MIN_VALUE, +0.0f,
+            0.0f, -0.0f, -Float.MIN_VALUE, -Float.MIN_NORMAL / 2,
+            -Float.MIN_NORMAL, -4.5f, -5.6442E21f, -Float.MAX_VALUE,
+            Float.NEGATIVE_INFINITY };
+
+    /**
+     * @tests {@link java.lang.Math#copySign(float, float)}
+     * @since 1.6
+     */
+    @SuppressWarnings("boxing")
+    public void test_copySign_FF() {
+        for (int i = 0; i < COPYSIGN_FF_CASES.length; i++) {
+            final float magnitude = COPYSIGN_FF_CASES[i];
+            final int absMagnitudeBits = Float.floatToIntBits(Math
+                    .abs(magnitude));
+            final int negMagnitudeBits = Float.floatToIntBits(-Math
+                    .abs(magnitude));
+
+            // cases for NaN
+            assertEquals("If the sign is NaN, the result should be positive.",
+                    absMagnitudeBits, Float.floatToIntBits(Math.copySign(
+                            magnitude, Float.NaN)));
+            assertTrue("The result should be NaN.", Float.isNaN(Math.copySign(
+                    Float.NaN, magnitude)));
+
+            for (int j = 0; j < COPYSIGN_FF_CASES.length; j++) {
+                final float sign = COPYSIGN_FF_CASES[j];
+                final int resultBits = Float.floatToIntBits(Math.copySign(
+                        magnitude, sign));
+                if (sign > 0 || Float.valueOf(+0.0f).equals(sign)
+                        || Float.valueOf(0.0f).equals(sign)) {
+                    assertEquals(
+                            "If the sign is positive, the result should be positive.",
+                            absMagnitudeBits, resultBits);
+                }
+                if (sign < 0 || Float.valueOf(-0.0f).equals(sign)) {
+                    assertEquals(
+                            "If the sign is negative, the result should be negative.",
+                            negMagnitudeBits, resultBits);
+                }
+            }
+        }
+
+        assertTrue("The result should be NaN.", Float.isNaN(Math.copySign(
+                Float.NaN, Float.NaN)));
+
+        try {
+            Math.copySign((Float) null, 2.3f);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
+        try {
+            Math.copySign(2.3f, (Float) null);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
+        try {
+            Math.copySign((Float) null, (Float) null);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
     }
 
+	/**
+	 * @tests java.lang.Math#cos(double)
+	 */
+	public void test_cosD() {
+		// Test for method double java.lang.Math.cos(double)
+		assertEquals("Incorrect answer", 1.0, Math.cos(0), 0D);
+		assertEquals("Incorrect answer", 0.5403023058681398, Math.cos(1), 0D);
+	}
+
     /**
      * @tests java.lang.Math#cosh(double)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "cosh",
-        args = {double.class}
-    )
     public void test_cosh_D() {
         // Test for special situations
         assertTrue(Double.isNaN(Math.cosh(Double.NaN)));
@@ -372,40 +343,21 @@
         assertEquals("Should return 1.0", 1.0, Math.cosh(Double.MIN_VALUE), 0D);
     }
     
-    /**
-     * @tests java.lang.Math#exp(double)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "exp",
-        args = {double.class}
-    )
-    public void test_expD() {
-        // Test for method double java.lang.Math.exp(double)
-        assertTrue("Incorrect answer returned for simple power", Math.abs(Math
-                .exp(4D)
-                - Math.E * Math.E * Math.E * Math.E) < 0.1D);
-        assertTrue("Incorrect answer returned for larger power", Math.log(Math
-                .abs(Math.exp(5.5D)) - 5.5D) < 10.0D);
-        
-        assertEquals("Incorrect returned value for NaN", 
-                                              Double.NaN, Math.exp(Double.NaN));
-        assertEquals("Incorrect returned value for positive infinity", 
-                  Double.POSITIVE_INFINITY, Math.exp(Double.POSITIVE_INFINITY));
-        assertEquals("Incorrect returned value for negative infinity", 
-                                      0, Math.exp(Double.NEGATIVE_INFINITY), 0);        
-    }
+	/**
+	 * @tests java.lang.Math#exp(double)
+	 */
+	public void test_expD() {
+		// Test for method double java.lang.Math.exp(double)
+		assertTrue("Incorrect answer returned for simple power", Math.abs(Math
+				.exp(4D)
+				- Math.E * Math.E * Math.E * Math.E) < 0.1D);
+		assertTrue("Incorrect answer returned for larger power", Math.log(Math
+				.abs(Math.exp(5.5D)) - 5.5D) < 10.0D);
+	}
     
     /**
      * @tests java.lang.Math#expm1(double)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "expm1",
-        args = {double.class}
-    )
     public void test_expm1_D() {
         // Test for special cases
         assertTrue("Should return NaN", Double.isNaN(Math.expm1(Double.NaN)));
@@ -414,11 +366,11 @@
         assertEquals("Should return -1.0", -1.0, Math
                 .expm1(Double.NEGATIVE_INFINITY), 0D);
         assertEquals(Double.doubleToLongBits(0.0), Double.doubleToLongBits(Math
-                .expm1(0.0)));
-        assertEquals(Double.doubleToLongBits(+0.0), Double
-                .doubleToLongBits(Math.expm1(+0.0)));
-        assertEquals(Double.doubleToLongBits(-0.0), Double
-                .doubleToLongBits(Math.expm1(-0.0)));
+				.expm1(0.0)));
+		assertEquals(Double.doubleToLongBits(+0.0), Double
+				.doubleToLongBits(Math.expm1(+0.0)));
+		assertEquals(Double.doubleToLongBits(-0.0), Double
+				.doubleToLongBits(Math.expm1(-0.0)));
 
         assertEquals("Should return -9.999950000166666E-6",
                 -9.999950000166666E-6, Math.expm1(-0.00001), 0D);
@@ -436,36 +388,123 @@
     /**
      * @tests java.lang.Math#floor(double)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "floor",
-        args = {double.class}
-    )
     public void test_floorD() {
-        // Test for method double java.lang.Math.floor(double)
-                assertEquals("Incorrect floor for double",
-                             78, Math.floor(78.89), 0);
-        assertEquals("Incorrect floor for double",
-                             -79, Math.floor(-78.89), 0);
-        assertEquals("Incorrect floor for integer",
-                              -78, Math.floor(-78), 0);
-        double [] args = {0, -0, Double.NaN, Double.POSITIVE_INFINITY, 
-                Double.NEGATIVE_INFINITY};
-        for(int i = 0; i < args.length; i++) {
-            assertEquals(args[i], Math.floor(args[i]));
-        }        
+        assertEquals("Incorrect floor for int", 42, Math.floor(42), 0);
+        assertEquals("Incorrect floor for -int", -2, Math.floor(-2), 0);
+        assertEquals("Incorrect floor for zero", 0d, Math.floor(0d), 0);
+
+        assertEquals("Incorrect floor for +double", 78, Math.floor(78.89), 0);
+        assertEquals("Incorrect floor for -double", -79, Math.floor(-78.89), 0);
+        assertEquals("floor large +double", 3.7314645675925406E19, Math.floor(3.7314645675925406E19), 0);
+        assertEquals("floor large -double", -8.173521839218E12, Math.floor(-8.173521839218E12), 0);
+        assertEquals("floor small double", 0.0d, Math.floor(1.11895241315E-102), 0);
+
+        // Compare toString representations here since -0.0 = +0.0, and
+        // NaN != NaN and we need to distinguish
+        assertEquals("Floor failed for NaN",
+                Double.toString(Double.NaN), Double.toString(Math.floor(Double.NaN)));
+        assertEquals("Floor failed for +0.0",
+                Double.toString(+0.0d), Double.toString(Math.floor(+0.0d)));
+        assertEquals("Floor failed for -0.0",
+                Double.toString(-0.0d), Double.toString(Math.floor(-0.0d)));
+        assertEquals("Floor failed for +infinity",
+                Double.toString(Double.POSITIVE_INFINITY), Double.toString(Math.floor(Double.POSITIVE_INFINITY)));
+        assertEquals("Floor failed for -infinity",
+                Double.toString(Double.NEGATIVE_INFINITY), Double.toString(Math.floor(Double.NEGATIVE_INFINITY)));
+    }
+	
+	/**
+     * cases for test_getExponent_D in MathTest/StrictMathTest
+     */
+    static final double GETEXPONENT_D_CASES[] = new double[] {
+            Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY,
+            Double.MAX_VALUE, -Double.MAX_VALUE, 2.342E231, -2.342E231, 2800.0,
+            -2800.0, 5.323, -5.323, 1.323, -1.323, 0.623, -0.623, 0.323,
+            -0.323, Double.MIN_NORMAL * 24, -Double.MIN_NORMAL * 24,
+            Double.MIN_NORMAL, -Double.MIN_NORMAL, Double.MIN_NORMAL / 2,
+            -Double.MIN_NORMAL / 2, Double.MIN_VALUE, -Double.MIN_VALUE, +0.0,
+            0.0, -0.0, Double.NaN };
+
+    /**
+     * result for test_getExponent_D in MathTest/StrictMathTest
+     */
+    static final int GETEXPONENT_D_RESULTS[] = new int[] {
+            Double.MAX_EXPONENT + 1, Double.MAX_EXPONENT + 1,
+            Double.MAX_EXPONENT, Double.MAX_EXPONENT, 768, 768, 11, 11, 2, 2,
+            0, 0, -1, -1, -2, -2, -1018, -1018, Double.MIN_EXPONENT,
+            Double.MIN_EXPONENT, Double.MIN_EXPONENT - 1,
+            Double.MIN_EXPONENT - 1, Double.MIN_EXPONENT - 1,
+            Double.MIN_EXPONENT - 1, Double.MIN_EXPONENT - 1,
+            Double.MIN_EXPONENT - 1, Double.MIN_EXPONENT - 1,
+            Double.MAX_EXPONENT + 1 };
+
+    /**
+     * @tests {@link java.lang.Math#getExponent(double)}
+     * @since 1.6
+     */
+    @SuppressWarnings("boxing")
+    public void test_getExponent_D() {
+        for (int i = 0; i < GETEXPONENT_D_CASES.length; i++) {
+            final double number = GETEXPONENT_D_CASES[i];
+            final int result = GETEXPONENT_D_RESULTS[i];
+            assertEquals("Wrong result of getExponent(double).", result, Math
+                    .getExponent(number));
+        }
+
+        try {
+            Math.getExponent((Double) null);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
+    }
+
+    /**
+     * cases for test_getExponent_F in MathTest/StrictMathTest
+     */
+    static final float GETEXPONENT_F_CASES[] = new float[] {
+            Float.POSITIVE_INFINITY, Float.NEGATIVE_INFINITY, Float.MAX_VALUE,
+            -Float.MAX_VALUE, 3.4256E23f, -3.4256E23f, 2800.0f, -2800.0f,
+            5.323f, -5.323f, 1.323f, -1.323f, 0.623f, -0.623f, 0.323f, -0.323f,
+            Float.MIN_NORMAL * 24, -Float.MIN_NORMAL * 24, Float.MIN_NORMAL,
+            -Float.MIN_NORMAL, Float.MIN_NORMAL / 2, -Float.MIN_NORMAL / 2,
+            Float.MIN_VALUE, -Float.MIN_VALUE, +0.0f, 0.0f, -0.0f, Float.NaN,1,Float.MIN_NORMAL * 1.5f };
+
+    /**
+     * result for test_getExponent_F in MathTest/StrictMathTest
+     */
+    static final int GETEXPONENT_F_RESULTS[] = new int[] {
+            Float.MAX_EXPONENT + 1, Float.MAX_EXPONENT + 1, Float.MAX_EXPONENT,
+            Float.MAX_EXPONENT, 78, 78, 11, 11, 2, 2, 0, 0, -1, -1, -2, -2,
+            -122, -122, Float.MIN_EXPONENT, Float.MIN_EXPONENT,
+            Float.MIN_EXPONENT - 1, Float.MIN_EXPONENT - 1,
+            Float.MIN_EXPONENT - 1, Float.MIN_EXPONENT - 1,
+            Float.MIN_EXPONENT - 1, Float.MIN_EXPONENT - 1,
+            Float.MIN_EXPONENT - 1, Float.MAX_EXPONENT + 1,0,Float.MIN_EXPONENT };
+    
+    /**
+     * @tests {@link java.lang.Math#getExponent(float)}
+     * @since 1.6
+     */
+    @SuppressWarnings("boxing")
+    public void test_getExponent_F() {
+        for (int i = 0; i < GETEXPONENT_F_CASES.length; i++) {
+            final float number = GETEXPONENT_F_CASES[i];
+            final int result = GETEXPONENT_F_RESULTS[i];
+            assertEquals("Wrong result of getExponent(float).", result, Math
+                    .getExponent(number));
+        }
+        try {
+            Math.getExponent((Float) null);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
     }
     
     /**
      * @tests java.lang.Math#hypot(double, double)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hypot",
-        args = {double.class, double.class}
-    )
     public void test_hypot_DD() {
         // Test for special cases
         assertEquals("Should return POSITIVE_INFINITY",
@@ -501,63 +540,34 @@
                 -5413.7185, Double.MIN_VALUE), 0D);
     }
 
-    /**
-     * @tests java.lang.Math#IEEEremainder(double, double)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "IEEEremainder",
-        args = {double.class, double.class}
-    )
-    public void test_IEEEremainderDD() {
-        // Test for method double java.lang.Math.IEEEremainder(double, double)
-        assertEquals("Incorrect remainder returned",
-                0.0, Math.IEEEremainder(1.0, 1.0), 0D);
-        assertTrue("Incorrect remainder returned", Math.IEEEremainder(1.32,
-                89.765) >= 1.4705063220631647E-2
-                || Math.IEEEremainder(1.32, 89.765) >= 1.4705063220631649E-2);
-        
-        assertEquals(Double.NaN, Math.IEEEremainder(Double.NaN, Double.NaN));
-        assertEquals(Double.NaN, Math.IEEEremainder(Double.NaN, 1.0));    
-        assertEquals(Double.NaN, Math.IEEEremainder(1.0, Double.NaN)); 
+	/**
+	 * @tests java.lang.Math#IEEEremainder(double, double)
+	 */
+	public void test_IEEEremainderDD() {
+		// Test for method double java.lang.Math.IEEEremainder(double, double)
+		assertEquals("Incorrect remainder returned",
+				0.0, Math.IEEEremainder(1.0, 1.0), 0D);
+		assertTrue("Incorrect remainder returned", Math.IEEEremainder(1.32,
+				89.765) >= 1.4705063220631647E-2
+				|| Math.IEEEremainder(1.32, 89.765) >= 1.4705063220631649E-2);
+	}
 
-        assertEquals(Double.NaN, Math.IEEEremainder(Double.POSITIVE_INFINITY, 1.0));     
-        assertEquals(Double.NaN, Math.IEEEremainder(Double.NEGATIVE_INFINITY, 1.0));
-        assertEquals(1.0, Math.IEEEremainder(1.0, Double.POSITIVE_INFINITY));
-        assertEquals(1.0, Math.IEEEremainder(1.0, Double.NEGATIVE_INFINITY));
-        assertEquals(Double.NaN, Math.IEEEremainder(1.0, 0.0));
-        assertEquals(Double.NaN, Math.IEEEremainder(1.0, -0.0));        
-    }
-
-    /**
-     * @tests java.lang.Math#log(double)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "log",
-        args = {double.class}
-    )
-    public void test_logD() {
-        // Test for method double java.lang.Math.log(double)
-        for (double d = 10; d >= -10; d -= 0.5) {
-            double answer = Math.log(Math.exp(d));
-            assertTrue("Answer does not equal expected answer for d = " + d
-                    + " answer = " + answer, Math.abs(answer - d) <= Math
-                    .abs(d * 0.00000001));
-        }
-    }
+	/**
+	 * @tests java.lang.Math#log(double)
+	 */
+	public void test_logD() {
+		// Test for method double java.lang.Math.log(double)
+		for (double d = 10; d >= -10; d -= 0.5) {
+			double answer = Math.log(Math.exp(d));
+			assertTrue("Answer does not equal expected answer for d = " + d
+					+ " answer = " + answer, Math.abs(answer - d) <= Math
+					.abs(d * 0.00000001));
+		}
+	}
     
     /**
      * @tests java.lang.Math#log10(double)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "log10",
-        args = {double.class}
-    )
     @SuppressWarnings("boxing")
     public void test_log10_D() {
         // Test for special cases
@@ -581,12 +591,6 @@
     /**
      * @tests java.lang.Math#log1p(double)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "log1p",
-        args = {double.class}
-    )
     public void test_log1p_D() {
         // Test for special cases
         assertTrue("Should return NaN", Double.isNaN(Math.log1p(Double.NaN)));
@@ -594,11 +598,11 @@
         assertEquals("Should return POSITIVE_INFINITY",
                 Double.POSITIVE_INFINITY, Math.log1p(Double.POSITIVE_INFINITY), 0D);
         assertEquals(Double.doubleToLongBits(0.0), Double.doubleToLongBits(Math
-                .log1p(0.0)));
-        assertEquals(Double.doubleToLongBits(+0.0), Double
-                .doubleToLongBits(Math.log1p(+0.0)));
-        assertEquals(Double.doubleToLongBits(-0.0), Double
-                .doubleToLongBits(Math.log1p(-0.0)));
+				.log1p(0.0)));
+		assertEquals(Double.doubleToLongBits(+0.0), Double
+				.doubleToLongBits(Math.log1p(+0.0)));
+		assertEquals(Double.doubleToLongBits(-0.0), Double
+				.doubleToLongBits(Math.log1p(-0.0)));
 
         assertEquals("Should return -0.2941782295312541", -0.2941782295312541,
                 Math.log1p(-0.254856327), 0D);
@@ -612,323 +616,1032 @@
                 .log1p(Double.MIN_VALUE), 0D);
     }
 
-    /**
-     * @tests java.lang.Math#max(double, double)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "max",
-        args = {double.class, double.class}
-    )
-    public void test_maxDD() {
-        // Test for method double java.lang.Math.max(double, double)
-        assertEquals("Incorrect double max value", 1908897.6000089, 
-                Math.max(-1908897.6000089,
-                1908897.6000089), 0D);
-        assertEquals("Incorrect double max value",
-                1908897.6000089, Math.max(2.0, 1908897.6000089), 0D);
-        assertEquals("Incorrect double max value", -2.0, Math.max(-2.0,
-                -1908897.6000089), 0D);
+	/**
+	 * @tests java.lang.Math#max(double, double)
+	 */
+	public void test_maxDD() {
+		// Test for method double java.lang.Math.max(double, double)
+		assertEquals("Incorrect double max value", 1908897.6000089, Math.max(-1908897.6000089,
+				1908897.6000089), 0D);
+		assertEquals("Incorrect double max value",
+				1908897.6000089, Math.max(2.0, 1908897.6000089), 0D);
+		assertEquals("Incorrect double max value", -2.0, Math.max(-2.0,
+				-1908897.6000089), 0D);
 
-        assertEquals("Incorrect returned value", Double.NaN, 
-                                                Math.max(-1.0, Double.NaN));
-        assertEquals("Incorrect returned value", Double.NaN, 
-                                                Math.max(Double.NaN, -1.0));
-        assertEquals("Incorrect returned value", 0, Math.max(0, -0), 0D);          
+		// Compare toString representations here since -0.0 = +0.0, and
+		// NaN != NaN and we need to distinguish
+        assertEquals("Max failed for NaN",
+                Double.toString(Double.NaN), Double.toString(Math.max(Double.NaN, 42.0d)));
+        assertEquals("Max failed for NaN",
+                Double.toString(Double.NaN), Double.toString(Math.max(42.0d, Double.NaN)));
+        assertEquals("Max failed for 0.0",
+                Double.toString(+0.0d), Double.toString(Math.max(+0.0d, -0.0d)));
+        assertEquals("Max failed for 0.0",
+                Double.toString(+0.0d), Double.toString(Math.max(-0.0d, +0.0d)));
+        assertEquals("Max failed for -0.0d",
+                Double.toString(-0.0d), Double.toString(Math.max(-0.0d, -0.0d)));
+        assertEquals("Max failed for 0.0",
+                Double.toString(+0.0d), Double.toString(Math.max(+0.0d, +0.0d)));
+	}
+
+	/**
+	 * @tests java.lang.Math#max(float, float)
+	 */
+	public void test_maxFF() {
+		// Test for method float java.lang.Math.max(float, float)
+		assertTrue("Incorrect float max value", Math.max(-1908897.600f,
+				1908897.600f) == 1908897.600f);
+		assertTrue("Incorrect float max value",
+				Math.max(2.0f, 1908897.600f) == 1908897.600f);
+		assertTrue("Incorrect float max value",
+				Math.max(-2.0f, -1908897.600f) == -2.0f);
+		
+	    // Compare toString representations here since -0.0 = +0.0, and
+        // NaN != NaN and we need to distinguish
+        assertEquals("Max failed for NaN",
+                Float.toString(Float.NaN), Float.toString(Math.max(Float.NaN, 42.0f)));
+        assertEquals("Max failed for NaN",
+                Float.toString(Float.NaN), Float.toString(Math.max(42.0f, Float.NaN)));
+        assertEquals("Max failed for 0.0",
+                Float.toString(+0.0f), Float.toString(Math.max(+0.0f, -0.0f)));
+        assertEquals("Max failed for 0.0",
+                Float.toString(+0.0f), Float.toString(Math.max(-0.0f, +0.0f)));
+        assertEquals("Max failed for -0.0f",
+                Float.toString(-0.0f), Float.toString(Math.max(-0.0f, -0.0f)));
+        assertEquals("Max failed for 0.0",
+                Float.toString(+0.0f), Float.toString(Math.max(+0.0f, +0.0f)));
+	}
+
+	/**
+	 * @tests java.lang.Math#max(int, int)
+	 */
+	public void test_maxII() {
+		// Test for method int java.lang.Math.max(int, int)
+		assertEquals("Incorrect int max value",
+				19088976, Math.max(-19088976, 19088976));
+		assertEquals("Incorrect int max value",
+				19088976, Math.max(20, 19088976));
+		assertEquals("Incorrect int max value", -20, Math.max(-20, -19088976));
+	}
+
+	/**
+	 * @tests java.lang.Math#max(long, long)
+	 */
+	public void test_maxJJ() {
+		// Test for method long java.lang.Math.max(long, long)
+		assertEquals("Incorrect long max value", 19088976000089L, Math.max(-19088976000089L,
+				19088976000089L));
+		assertEquals("Incorrect long max value",
+				19088976000089L, Math.max(20, 19088976000089L));
+		assertEquals("Incorrect long max value",
+				-20, Math.max(-20, -19088976000089L));
+	}
+
+	/**
+	 * @tests java.lang.Math#min(double, double)
+	 */
+	public void test_minDD() {
+		// Test for method double java.lang.Math.min(double, double)
+		assertEquals("Incorrect double min value", -1908897.6000089, Math.min(-1908897.6000089,
+				1908897.6000089), 0D);
+		assertEquals("Incorrect double min value",
+				2.0, Math.min(2.0, 1908897.6000089), 0D);
+		assertEquals("Incorrect double min value", -1908897.6000089, Math.min(-2.0,
+				-1908897.6000089), 0D);
+		assertEquals("Incorrect double min value", 1.0d, Math.min(1.0d, 1.0d));
+		
+	    // Compare toString representations here since -0.0 = +0.0, and
+        // NaN != NaN and we need to distinguish
+        assertEquals("Min failed for NaN",
+                Double.toString(Double.NaN), Double.toString(Math.min(Double.NaN, 42.0d)));
+        assertEquals("Min failed for NaN",
+                Double.toString(Double.NaN), Double.toString(Math.min(42.0d, Double.NaN)));
+        assertEquals("Min failed for -0.0",
+                Double.toString(-0.0d), Double.toString(Math.min(+0.0d, -0.0d)));
+        assertEquals("Min failed for -0.0",
+                Double.toString(-0.0d), Double.toString(Math.min(-0.0d, +0.0d)));
+        assertEquals("Min failed for -0.0d",
+                Double.toString(-0.0d), Double.toString(Math.min(-0.0d, -0.0d)));
+        assertEquals("Min failed for 0.0",
+                Double.toString(+0.0d), Double.toString(Math.min(+0.0d, +0.0d)));
+	}
+
+	/**
+	 * @tests java.lang.Math#min(float, float)
+	 */
+	public void test_minFF() {
+		// Test for method float java.lang.Math.min(float, float)
+		assertTrue("Incorrect float min value", Math.min(-1908897.600f,
+				1908897.600f) == -1908897.600f);
+		assertTrue("Incorrect float min value",
+				Math.min(2.0f, 1908897.600f) == 2.0f);
+		assertTrue("Incorrect float min value",
+				Math.min(-2.0f, -1908897.600f) == -1908897.600f);
+		assertEquals("Incorrect float min value", 1.0f, Math.min(1.0f, 1.0f));
+
+        // Compare toString representations here since -0.0 = +0.0, and
+        // NaN != NaN and we need to distinguish
+        assertEquals("Min failed for NaN",
+                Float.toString(Float.NaN), Float.toString(Math.min(Float.NaN, 42.0f)));
+        assertEquals("Min failed for NaN",
+                Float.toString(Float.NaN), Float.toString(Math.min(42.0f, Float.NaN)));
+        assertEquals("Min failed for -0.0",
+                Float.toString(-0.0f), Float.toString(Math.min(+0.0f, -0.0f)));
+        assertEquals("Min failed for -0.0",
+                Float.toString(-0.0f), Float.toString(Math.min(-0.0f, +0.0f)));
+        assertEquals("Min failed for -0.0f",
+                Float.toString(-0.0f), Float.toString(Math.min(-0.0f, -0.0f)));
+        assertEquals("Min failed for 0.0",
+                Float.toString(+0.0f), Float.toString(Math.min(+0.0f, +0.0f)));
+	}
+
+	/**
+	 * @tests java.lang.Math#min(int, int)
+	 */
+	public void test_minII() {
+		// Test for method int java.lang.Math.min(int, int)
+		assertEquals("Incorrect int min value",
+				-19088976, Math.min(-19088976, 19088976));
+		assertEquals("Incorrect int min value", 20, Math.min(20, 19088976));
+		assertEquals("Incorrect int min value",
+				-19088976, Math.min(-20, -19088976));
+
+	}
+
+	/**
+	 * @tests java.lang.Math#min(long, long)
+	 */
+	public void test_minJJ() {
+		// Test for method long java.lang.Math.min(long, long)
+		assertEquals("Incorrect long min value", -19088976000089L, Math.min(-19088976000089L,
+				19088976000089L));
+		assertEquals("Incorrect long min value",
+				20, Math.min(20, 19088976000089L));
+		assertEquals("Incorrect long min value",
+				-19088976000089L, Math.min(-20, -19088976000089L));
+	}
+	
+	/**
+     * start number cases for test_nextAfter_DD in MathTest/StrictMathTest
+     * NEXTAFTER_DD_START_CASES[i][0] is the start number
+     * NEXTAFTER_DD_START_CASES[i][1] is the nextUp of start number
+     * NEXTAFTER_DD_START_CASES[i][2] is the nextDown of start number
+     */
+    static final double NEXTAFTER_DD_START_CASES[][] = new double[][] {
+            { 3.4, 3.4000000000000004, 3.3999999999999995 },
+            { -3.4, -3.3999999999999995, -3.4000000000000004 },
+            { 3.4233E109, 3.4233000000000005E109, 3.4232999999999996E109 },
+            { -3.4233E109, -3.4232999999999996E109, -3.4233000000000005E109 },
+            { +0.0, Double.MIN_VALUE, -Double.MIN_VALUE },
+            { 0.0, Double.MIN_VALUE, -Double.MIN_VALUE },
+            { -0.0, Double.MIN_VALUE, -Double.MIN_VALUE },
+            { Double.MIN_VALUE, 1.0E-323, +0.0 },
+            { -Double.MIN_VALUE, -0.0, -1.0E-323 },
+            { Double.MIN_NORMAL, 2.225073858507202E-308, 2.225073858507201E-308 },
+            { -Double.MIN_NORMAL, -2.225073858507201E-308,
+                    -2.225073858507202E-308 },
+            { Double.MAX_VALUE, Double.POSITIVE_INFINITY,
+                    1.7976931348623155E308 },
+            { -Double.MAX_VALUE, -1.7976931348623155E308,
+                    Double.NEGATIVE_INFINITY },
+            { Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY,
+                    Double.MAX_VALUE },
+            { Double.NEGATIVE_INFINITY, -Double.MAX_VALUE,
+                    Double.NEGATIVE_INFINITY } };
+
+    /**
+     * direction number cases for test_nextAfter_DD/test_nextAfter_FD in
+     * MathTest/StrictMathTest
+     */
+    static final double NEXTAFTER_DD_FD_DIRECTION_CASES[] = new double[] {
+            Double.POSITIVE_INFINITY, Double.MAX_VALUE, 8.8, 3.4, 1.4,
+            Double.MIN_NORMAL, Double.MIN_NORMAL / 2, Double.MIN_VALUE, +0.0,
+            0.0, -0.0, -Double.MIN_VALUE, -Double.MIN_NORMAL / 2,
+            -Double.MIN_NORMAL, -1.4, -3.4, -8.8, -Double.MAX_VALUE,
+            Double.NEGATIVE_INFINITY };
+
+    /**
+     * @tests {@link java.lang.Math#nextAfter(double, double)}
+     * @since 1.6
+     */
+    @SuppressWarnings("boxing")
+    public void test_nextAfter_DD() {
+        // test for most cases without exception
+        for (int i = 0; i < NEXTAFTER_DD_START_CASES.length; i++) {
+            final double start = NEXTAFTER_DD_START_CASES[i][0];
+            final long nextUpBits = Double
+                    .doubleToLongBits(NEXTAFTER_DD_START_CASES[i][1]);
+            final long nextDownBits = Double
+                    .doubleToLongBits(NEXTAFTER_DD_START_CASES[i][2]);
+
+            for (int j = 0; j < NEXTAFTER_DD_FD_DIRECTION_CASES.length; j++) {
+                final double direction = NEXTAFTER_DD_FD_DIRECTION_CASES[j];
+                final long resultBits = Double.doubleToLongBits(Math.nextAfter(
+                        start, direction));
+                final long directionBits = Double.doubleToLongBits(direction);
+                if (direction > start) {
+                    assertEquals("Result should be next up-number.",
+                            nextUpBits, resultBits);
+                } else if (direction < start) {
+                    assertEquals("Result should be next down-number.",
+                            nextDownBits, resultBits);
+                } else {
+                    assertEquals("Result should be direction.", directionBits,
+                            resultBits);
+                }
+            }
+        }
+
+        // test for cases with NaN
+        for (int i = 0; i < NEXTAFTER_DD_START_CASES.length; i++) {
+            assertTrue("The result should be NaN.", Double.isNaN(Math
+                    .nextAfter(NEXTAFTER_DD_START_CASES[i][0], Double.NaN)));
+        }
+        for (int i = 0; i < NEXTAFTER_DD_FD_DIRECTION_CASES.length; i++) {
+            assertTrue("The result should be NaN.", Double.isNaN(Math
+                    .nextAfter(Double.NaN, NEXTAFTER_DD_FD_DIRECTION_CASES[i])));
+        }
+        assertTrue("The result should be NaN.", Double.isNaN(Math.nextAfter(
+                Double.NaN, Double.NaN)));
+
+        // test for exception
+        try {
+            Math.nextAfter((Double) null, 2.3);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
+        try {
+            Math.nextAfter(2.3, (Double) null);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
+        try {
+            Math.nextAfter((Double) null, (Double) null);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
     }
 
     /**
-     * @tests java.lang.Math#max(float, float)
+     * start number cases for test_nextAfter_FD in MathTest/StrictMathTest
+     * NEXTAFTER_FD_START_CASES[i][0] is the start number
+     * NEXTAFTER_FD_START_CASES[i][1] is the nextUp of start number
+     * NEXTAFTER_FD_START_CASES[i][2] is the nextDown of start number
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "max",
-        args = {float.class, float.class}
-    )
-    public void test_maxFF() {
-        // Test for method float java.lang.Math.max(float, float)
-        assertTrue("Incorrect float max value", Math.max(-1908897.600f,
-                1908897.600f) == 1908897.600f);
-        assertTrue("Incorrect float max value",
-                Math.max(2.0f, 1908897.600f) == 1908897.600f);
-        assertTrue("Incorrect float max value",
-                Math.max(-2.0f, -1908897.600f) == -2.0f);
-        assertEquals("Incorrect returned value", Float.NaN, 
-                Math.max(-1.0f, Float.NaN));
-        assertEquals("Incorrect returned value", Float.NaN, 
-                Math.max(Float.NaN, -1.0f));
-        assertEquals("Incorrect returned value", 0f, Math.max(0f, -0f));         
+    static final float NEXTAFTER_FD_START_CASES[][] = new float[][] {
+            { 3.4f, 3.4000003f, 3.3999999f },
+            { -3.4f, -3.3999999f, -3.4000003f },
+            { 3.4233E19f, 3.4233002E19f, 3.4232998E19f },
+            { -3.4233E19f, -3.4232998E19f, -3.4233002E19f },
+            { +0.0f, Float.MIN_VALUE, -Float.MIN_VALUE },
+            { 0.0f, Float.MIN_VALUE, -Float.MIN_VALUE },
+            { -0.0f, Float.MIN_VALUE, -Float.MIN_VALUE },
+            { Float.MIN_VALUE, 2.8E-45f, +0.0f },
+            { -Float.MIN_VALUE, -0.0f, -2.8E-45f },
+            { Float.MIN_NORMAL, 1.1754945E-38f, 1.1754942E-38f },
+            { -Float.MIN_NORMAL, -1.1754942E-38f, -1.1754945E-38f },
+            { Float.MAX_VALUE, Float.POSITIVE_INFINITY, 3.4028233E38f },
+            { -Float.MAX_VALUE, -3.4028233E38f, Float.NEGATIVE_INFINITY },
+            { Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY, Float.MAX_VALUE },
+            { Float.NEGATIVE_INFINITY, -Float.MAX_VALUE,
+                    Float.NEGATIVE_INFINITY } };
+
+    /**
+     * @tests {@link java.lang.Math#nextAfter(float, double)}
+     * @since 1.6
+     */
+    @SuppressWarnings("boxing")
+    public void test_nextAfter_FD() {
+        // test for most cases without exception
+        for (int i = 0; i < NEXTAFTER_FD_START_CASES.length; i++) {
+            final float start = NEXTAFTER_FD_START_CASES[i][0];
+            final int nextUpBits = Float
+                    .floatToIntBits(NEXTAFTER_FD_START_CASES[i][1]);
+            final int nextDownBits = Float
+                    .floatToIntBits(NEXTAFTER_FD_START_CASES[i][2]);
+
+            for (int j = 0; j < NEXTAFTER_DD_FD_DIRECTION_CASES.length; j++) {
+                final double direction = NEXTAFTER_DD_FD_DIRECTION_CASES[j];
+                final int resultBits = Float.floatToIntBits(Math.nextAfter(
+                        start, direction));
+                if (direction > start) {
+                    assertEquals("Result should be next up-number.",
+                            nextUpBits, resultBits);
+                } else if (direction < start) {
+                    assertEquals("Result should be next down-number.",
+                            nextDownBits, resultBits);
+                } else {
+                    final int equivalentBits = Float.floatToIntBits(new Float(
+                            direction));
+                    assertEquals(
+                            "Result should be a number equivalent to direction.",
+                            equivalentBits, resultBits);
+                }
+            }
+        }
+
+        // test for cases with NaN
+        for (int i = 0; i < NEXTAFTER_FD_START_CASES.length; i++) {
+            assertTrue("The result should be NaN.", Float.isNaN(Math.nextAfter(
+                    NEXTAFTER_FD_START_CASES[i][0], Float.NaN)));
+        }
+        for (int i = 0; i < NEXTAFTER_DD_FD_DIRECTION_CASES.length; i++) {
+            assertTrue("The result should be NaN.", Float.isNaN(Math.nextAfter(
+                    Float.NaN, NEXTAFTER_DD_FD_DIRECTION_CASES[i])));
+        }
+        assertTrue("The result should be NaN.", Float.isNaN(Math.nextAfter(
+                Float.NaN, Float.NaN)));
+
+        // test for exception
+        try {
+            Math.nextAfter((Float) null, 2.3);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
+        try {
+            Math.nextAfter(2.3, (Float) null);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
+        try {
+            Math.nextAfter((Float) null, (Float) null);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
     }
 
     /**
-     * @tests java.lang.Math#max(int, int)
+     * @tests {@link java.lang.Math#nextUp(double)}
+     * @since 1.6
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "max",
-        args = {int.class, int.class}
-    )    
-    public void test_maxII() {
-        // Test for method int java.lang.Math.max(int, int)
-        assertEquals("Incorrect int max value",
-                19088976, Math.max(-19088976, 19088976));
-        assertEquals("Incorrect int max value",
-                19088976, Math.max(20, 19088976));
-        assertEquals("Incorrect int max value", -20, Math.max(-20, -19088976));
+    @SuppressWarnings("boxing")
+    public void test_nextUp_D() {
+        // This method is semantically equivalent to nextAfter(d,
+        // Double.POSITIVE_INFINITY),
+        // so we use the data of test_nextAfter_DD
+        for (int i = 0; i < NEXTAFTER_DD_START_CASES.length; i++) {
+            final double start = NEXTAFTER_DD_START_CASES[i][0];
+            final long nextUpBits = Double
+                    .doubleToLongBits(NEXTAFTER_DD_START_CASES[i][1]);
+            final long resultBits = Double.doubleToLongBits(Math.nextUp(start));
+            assertEquals("Result should be next up-number.", nextUpBits,
+                    resultBits);
+        }
+
+        // test for cases with NaN
+        assertTrue("The result should be NaN.", Double.isNaN(Math
+                .nextUp(Double.NaN)));
+
+        // test for exception
+        try {
+            Math.nextUp((Double) null);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
     }
 
     /**
-     * @tests java.lang.Math#max(long, long)
+     * @tests {@link java.lang.Math#nextUp(float)}
+     * @since 1.6
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "max",
-        args = {long.class, long.class}
-    )        
-    public void test_maxJJ() {
-        // Test for method long java.lang.Math.max(long, long)
-        assertEquals("Incorrect long max value", 19088976000089L, Math.max(-19088976000089L,
-                19088976000089L));
-        assertEquals("Incorrect long max value",
-                19088976000089L, Math.max(20, 19088976000089L));
-        assertEquals("Incorrect long max value",
-                -20, Math.max(-20, -19088976000089L));
+    @SuppressWarnings("boxing")
+    public void test_nextUp_F() {
+        // This method is semantically equivalent to nextAfter(f,
+        // Float.POSITIVE_INFINITY),
+        // so we use the data of test_nextAfter_FD
+        for (int i = 0; i < NEXTAFTER_FD_START_CASES.length; i++) {
+            final float start = NEXTAFTER_FD_START_CASES[i][0];
+            final int nextUpBits = Float
+                    .floatToIntBits(NEXTAFTER_FD_START_CASES[i][1]);
+            final int resultBits = Float.floatToIntBits(Math.nextUp(start));
+            assertEquals("Result should be next up-number.", nextUpBits,
+                    resultBits);
+        }
+
+        // test for cases with NaN
+        assertTrue("The result should be NaN.", Float.isNaN(Math
+                .nextUp(Float.NaN)));
+
+        // test for exception
+        try {
+            Math.nextUp((Float) null);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
     }
 
-    /**
-     * @tests java.lang.Math#min(double, double)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "min",
-        args = {double.class, double.class}
-    )
-    public void test_minDD() {
-        // Test for method double java.lang.Math.min(double, double)
-        assertEquals("Incorrect double min value", -1908897.6000089, Math.min(-1908897.6000089,
-                1908897.6000089), 0D);
-        assertEquals("Incorrect double min value",
-                2.0, Math.min(2.0, 1908897.6000089), 0D);
-        assertEquals("Incorrect double min value", -1908897.6000089, Math.min(-2.0,
-                -1908897.6000089), 0D);
-        assertEquals("Incorrect returned value", Double.NaN, 
-                Math.min(-1.0, Double.NaN));
-        assertEquals("Incorrect returned value", Double.NaN, 
-                Math.min(Double.NaN, -1.0));
-        assertEquals("Incorrect returned value", -0.0, Math.min(0.0, -0.0));        
-    }
+	/**
+	 * @tests java.lang.Math#pow(double, double)
+	 */
+	public void test_powDD() {
+		// Test for method double java.lang.Math.pow(double, double)
+        double NZERO = longTodouble(doubleTolong(0.0) ^ 0x8000000000000000L);
+        double p1 = 1.0;
+        double p2 = 2.0;
+        double p3 = 3.0;
+        double p4 = 4.0;
+        double p5 = 5.0;
+        double p6 = 6.0;
+        double p7 = 7.0;
+        double p8 = 8.0;
+        double p9 = 9.0;
+        double p10 = 10.0;
+        double p11 = 11.0;
+        double p12 = 12.0;
+        double p13 = 13.0;
+        double p14 = 14.0;
+        double p15 = 15.0;
+        double p16 = 16.0;
+        double[] values = { p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12,
+                p13, p14, p15, p16 };
 
-    /**
-     * @tests java.lang.Math#min(float, float)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "min",
-        args = {float.class, float.class}
-    )
-    public void test_minFF() {
-        // Test for method float java.lang.Math.min(float, float)
-        assertTrue("Incorrect float min value", Math.min(-1908897.600f,
-                1908897.600f) == -1908897.600f);
-        assertTrue("Incorrect float min value",
-                Math.min(2.0f, 1908897.600f) == 2.0f);
-        assertTrue("Incorrect float min value",
-                Math.min(-2.0f, -1908897.600f) == -1908897.600f);
-        assertEquals("Incorrect returned value", Float.NaN, 
-                Math.min(-1.0f, Float.NaN));
-        assertEquals("Incorrect returned value", Float.NaN, 
-                Math.min(Float.NaN, -1.0f));
-        assertEquals("Incorrect returned value", -0f, Math.min(0f, -0f));        
-    }
+        for (int x = 0; x < values.length; x++) {
+            double dval = values[x];
+            double nagateDval = negateDouble(dval);
+            if (nagateDval == Double.NaN) {
+                continue;
+            }
 
-    /**
-     * @tests java.lang.Math#min(int, int)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "min",
-        args = {int.class, int.class}
-    )
-    public void test_minII() {
-        // Test for method int java.lang.Math.min(int, int)
-        assertEquals("Incorrect int min value",
-                -19088976, Math.min(-19088976, 19088976));
-        assertEquals("Incorrect int min value", 20, Math.min(20, 19088976));
-        assertEquals("Incorrect int min value",
-                -19088976, Math.min(-20, -19088976));
+            // If the second argument is positive or negative zero, then the
+            // result is 1.0.
+            assertEquals("Result should be Math.pow(" + dval
+                    + ",-0.0)=+1.0", 1.0, Math.pow(dval, NZERO));
+            assertEquals("Result should be Math.pow(" + nagateDval
+                    + ",-0.0)=+1.0", 1.0, Math.pow(nagateDval, NZERO));
+            assertEquals("Result should be Math.pow(" + dval
+                    + ",+0.0)=+1.0", 1.0, Math.pow(dval, +0.0));
+            assertEquals("Result should be Math.pow(" + nagateDval
+                    + ",+0.0)=+1.0", 1.0, Math.pow(nagateDval, +0.0));
 
-    }
+            // If the second argument is 1.0, then the result is the same as the
+            // first argument.
+            assertEquals("Result should be Math.pow(" + dval + "," + 1.0 + ")="
+                    + dval, dval, Math.pow(dval, 1.0));
+            assertEquals("Result should be Math.pow(" + nagateDval + "," + 1.0
+                    + ")=" + nagateDval, nagateDval, Math.pow(nagateDval, 1.0));
 
-    /**
-     * @tests java.lang.Math#min(long, long)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "min",
-        args = {long.class, long.class}
-    )
-    public void test_minJJ() {
-        // Test for method long java.lang.Math.min(long, long)
-        assertEquals("Incorrect long min value", -19088976000089L, Math.min(-19088976000089L,
-                19088976000089L));
-        assertEquals("Incorrect long min value",
-                20, Math.min(20, 19088976000089L));
-        assertEquals("Incorrect long min value",
-                -19088976000089L, Math.min(-20, -19088976000089L));
-    }
+            // If the second argument is NaN, then the result is NaN.
+            assertEquals("Result should be Math.pow(" + dval + "," + Double.NaN
+                    + ")=" + Double.NaN,  Double.NaN, Math.pow(dval, Double.NaN));
+            assertEquals("Result should be Math.pow(" + nagateDval + ","
+                    + Double.NaN + ")=" + Double.NaN,  Double.NaN, Math.pow(nagateDval,
+                    Double.NaN));
 
-    /**
-     * @tests java.lang.Math#pow(double, double)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "pow",
-        args = {double.class, double.class}
-    )
-    public void test_powDD() {
-        // Test for method double java.lang.Math.pow(double, double)
-        assertTrue("pow returned incorrect value",
-                (long) Math.pow(2, 8) == 256l);
-        assertTrue("pow returned incorrect value",
-                Math.pow(2, -8) == 0.00390625d);
-        assertEquals("Incorrect root returned1",
+            if (dval > 1) {
+                // If the first argument is NaN and the second argument is
+                // nonzero,
+                // then the result is NaN.
+                assertEquals("Result should be Math.pow(" + Double.NaN + ","
+                        + dval + ")=" + Double.NaN,  Double.NaN, Math.pow(Double.NaN, dval));
+                assertEquals("Result should be Math.pow(" + Double.NaN + ","
+                        + nagateDval + ")=" + Double.NaN,  Double.NaN, Math.pow(Double.NaN,
+                        nagateDval));
+
+                /*
+                 * If the first argument is positive zero and the second
+                 * argument is greater than zero, or the first argument is
+                 * positive infinity and the second argument is less than zero,
+                 * then the result is positive zero.
+                 */
+                assertEquals("Result should be Math.pow(" + 0.0 + "," + dval
+                        + ")=" + 0.0, +0.0, Math.pow(0.0, dval));
+                assertEquals("Result should be Math.pow("
+                        + Double.POSITIVE_INFINITY + "," + nagateDval + ")="
+                        + 0.0, +0.0, Math.pow(Double.POSITIVE_INFINITY, nagateDval));
+
+                /*
+                 * If the first argument is positive zero and the second
+                 * argument is less than zero, or the first argument is positive
+                 * infinity and the second argument is greater than zero, then
+                 * the result is positive infinity.
+                 */
+                assertEquals("Result should be Math.pow(" + 0.0 + ","
+                        + nagateDval + ")=" + Double.POSITIVE_INFINITY,Double.POSITIVE_INFINITY,
+                        Math.pow(0.0, nagateDval));
+                assertEquals("Result should be Math.pow("
+                        + Double.POSITIVE_INFINITY + "," + dval + ")="
+                        + Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, Math.pow(
+                        Double.POSITIVE_INFINITY, dval));
+
+                // Not a finite odd integer
+                if (dval % 2 == 0) {
+                    /*
+                     * If the first argument is negative zero and the second
+                     * argument is greater than zero but not a finite odd
+                     * integer, or the first argument is negative infinity and
+                     * the second argument is less than zero but not a finite
+                     * odd integer, then the result is positive zero.
+                     */
+                    assertEquals("Result should be Math.pow(" + NZERO + ","
+                            + dval + ")=" + 0.0, +0.0, Math.pow(NZERO, dval));
+                    assertEquals("Result should be Math.pow("
+                            + Double.NEGATIVE_INFINITY + "," + nagateDval
+                            + ")=" + 0.0, +0.0, Math.pow(Double.NEGATIVE_INFINITY,
+                            nagateDval));
+
+                    /*
+                     * If the first argument is negative zero and the second
+                     * argument is less than zero but not a finite odd integer,
+                     * or the first argument is negative infinity and the second
+                     * argument is greater than zero but not a finite odd
+                     * integer, then the result is positive infinity.
+                     */
+                    assertEquals("Result should be Math.pow(" + NZERO + ","
+                            + nagateDval + ")=" + Double.POSITIVE_INFINITY,Double.POSITIVE_INFINITY,
+                            Math.pow(NZERO, nagateDval));
+                    assertEquals("Result should be Math.pow("
+                            + Double.NEGATIVE_INFINITY + "," + dval + ")="
+                            + Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, Math.pow(
+                            Double.NEGATIVE_INFINITY, dval));
+                }
+
+                // finite odd integer
+                if (dval % 2 != 0) {
+                    /*
+                     * If the first argument is negative zero and the second
+                     * argument is a positive finite odd integer, or the first
+                     * argument is negative infinity and the second argument is
+                     * a negative finite odd integer, then the result is
+                     * negative zero.
+                     */
+                    assertEquals("Result should be Math.pow(" + NZERO + ","
+                            + dval + ")=" + NZERO, NZERO, Math.pow(NZERO, dval));
+                    assertEquals("Result should be Math.pow("
+                            + Double.NEGATIVE_INFINITY + "," + nagateDval
+                            + ")=" + NZERO, NZERO, Math.pow(Double.NEGATIVE_INFINITY,
+                            nagateDval));
+                    /*
+                     * If the first argument is negative zero and the second
+                     * argument is a negative finite odd integer, or the first
+                     * argument is negative infinity and the second argument is
+                     * a positive finite odd integer then the result is negative
+                     * infinity.
+                     */
+                    assertEquals("Result should be Math.pow(" + NZERO + ","
+                            + nagateDval + ")=" + Double.NEGATIVE_INFINITY,Double.NEGATIVE_INFINITY,
+                            Math.pow(NZERO, nagateDval));
+                    assertEquals("Result should be Math.pow("
+                            + Double.NEGATIVE_INFINITY + "," + dval + ")="
+                            + Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY, Math.pow(
+                            Double.NEGATIVE_INFINITY, dval));
+                }
+
+                /**
+                 * 1. If the first argument is finite and less than zero if the
+                 * second argument is a finite even integer, the result is equal
+                 * to the result of raising the absolute value of the first
+                 * argument to the power of the second argument 
+                 * 
+                 * 2. if the second argument is a finite odd integer, the result is equal to the
+                 * negative of the result of raising the absolute value of the
+                 * first argument to the power of the second argument 
+                 * 
+                 * 3. if the second argument is finite and not an integer, then the result
+                 * is NaN.
+                 */
+                for (int j = 1; j < values.length; j++) {
+                    double jval = values[j];
+                    if (jval % 2.0 == 0.0) {
+                        assertEquals("" + nagateDval + " " + jval, Math.pow(
+                                dval, jval), Math.pow(nagateDval, jval));
+                    } else {
+                        assertEquals("" + nagateDval + " " + jval, -1.0
+                                * Math.pow(dval, jval), Math.pow(nagateDval,
+                                jval));
+                    }
+                    assertEquals(Double.NaN, Math
+                            .pow(nagateDval, jval / 0.5467));
+                    assertEquals(Double.NaN, Math.pow(nagateDval, -1.0 * jval
+                            / 0.5467));
+                }
+            }
+
+            // If the absolute value of the first argument equals 1 and the
+            // second argument is infinite, then the result is NaN.
+            if (dval == 1) {
+                assertEquals("Result should be Math.pow(" + dval + ","
+                        + Double.POSITIVE_INFINITY + ")=" + Double.NaN, Double.NaN, Math
+                        .pow(dval, Double.POSITIVE_INFINITY));
+                assertEquals("Result should be Math.pow(" + dval + ","
+                        + Double.NEGATIVE_INFINITY + ")=" + Double.NaN, Double.NaN, Math
+                        .pow(dval, Double.NEGATIVE_INFINITY));
+
+                assertEquals("Result should be Math.pow(" + nagateDval + ","
+                        + Double.POSITIVE_INFINITY + ")=" + Double.NaN, Double.NaN, Math
+                        .pow(nagateDval, Double.POSITIVE_INFINITY));
+                assertEquals("Result should be Math.pow(" + nagateDval + ","
+                        + Double.NEGATIVE_INFINITY + ")=" + Double.NaN, Double.NaN, Math
+                        .pow(nagateDval, Double.NEGATIVE_INFINITY));
+            }
+
+            if (dval > 1) {
+                /*
+                 * If the absolute value of the first argument is greater than 1
+                 * and the second argument is positive infinity, or the absolute
+                 * value of the first argument is less than 1 and the second
+                 * argument is negative infinity, then the result is positive
+                 * infinity.
+                 */
+                assertEquals("Result should be Math.pow(" + dval + ","
+                        + Double.POSITIVE_INFINITY + ")="
+                        + Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, Math.pow(dval,
+                        Double.POSITIVE_INFINITY));
+
+                assertEquals("Result should be Math.pow(" + nagateDval + ","
+                        + Double.NEGATIVE_INFINITY + ")="
+                        + Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, Math.pow(-0.13456,
+                        Double.NEGATIVE_INFINITY));
+
+                /*
+                 * If the absolute value of the first argument is greater than 1
+                 * and the second argument is negative infinity, or the absolute
+                 * value of the first argument is less than 1 and the second
+                 * argument is positive infinity, then the result is positive
+                 * zero.
+                 */
+                assertEquals("Result should be Math.pow(" + dval + ","
+                        + Double.NEGATIVE_INFINITY + ")= +0.0", +0.0, Math.pow(dval,
+                        Double.NEGATIVE_INFINITY));
+                assertEquals("Result should be Math.pow(" + nagateDval + ","
+                        + Double.POSITIVE_INFINITY + ")= +0.0", +0.0, Math.pow(
+                        -0.13456, Double.POSITIVE_INFINITY));
+            }
+
+            assertEquals("Result should be Math.pow(" + 0.0 + "," + dval + ")="
+                    + 0.0, 0.0, Math.pow(0.0, dval));
+            assertEquals("Result should be Math.pow(" + Double.NaN + "," + dval
+                    + ")=" + Double.NaN, Double.NaN, Math.pow(Double.NaN, dval));
+        }
+		assertTrue("pow returned incorrect value",
+				(long) Math.pow(2, 8) == 256l);
+		assertTrue("pow returned incorrect value",
+				Math.pow(2, -8) == 0.00390625d);
+		assertEquals("Incorrect root returned1",
                              2, Math.sqrt(Math.pow(Math.sqrt(2), 4)), 0);
-        
-        assertEquals("pow returned incorrect value", 1.0, Math.pow(1, 0));
-        assertEquals("pow returned incorrect value", 2.0, Math.pow(2, 1));
-        assertEquals("pow returned incorrect value", Double.NaN, 
-                                        Math.pow(Double.MAX_VALUE, Double.NaN)); 
-        assertEquals("pow returned incorrect value", Double.NaN, 
-                                        Math.pow(Double.NaN, Double.MAX_VALUE));        
-        assertEquals("pow returned incorrect value", Double.POSITIVE_INFINITY, 
-                                       Math.pow(1.1, Double.POSITIVE_INFINITY));      
-        assertEquals("pow returned incorrect value", Double.POSITIVE_INFINITY, 
-                                       Math.pow(0.9, Double.NEGATIVE_INFINITY));   
-        
-        assertEquals("pow returned incorrect value", 0.0, 
-                                       Math.pow(1.1, Double.NEGATIVE_INFINITY));
-        assertEquals("pow returned incorrect value", 0.0, 
-                                       Math.pow(0.9, Double.POSITIVE_INFINITY));   
-        
-        assertEquals("pow returned incorrect value", Double.NaN, 
-                                       Math.pow(1.0, Double.NEGATIVE_INFINITY));
-        assertEquals("pow returned incorrect value", Double.NaN, 
-                                       Math.pow(1.0, Double.POSITIVE_INFINITY)); 
 
-        assertEquals("pow returned incorrect value", 0.0, Math.pow(0, 1));
-        assertEquals("pow returned incorrect value", 0.0, 
-                                      Math.pow(Double.POSITIVE_INFINITY, -0.1));
+		assertEquals(Double.NEGATIVE_INFINITY, Math.pow(-10.0, 3.093403029238847E15));
+		assertEquals(Double.POSITIVE_INFINITY, Math.pow(10.0, 3.093403029238847E15));
+	}
+
+    private double longTodouble(long longvalue) {
+        return Double.longBitsToDouble(longvalue);
+    }
+
+    private long doubleTolong(double doublevalue) {
+        return Double.doubleToLongBits(doublevalue);
+    }
+
+    private double negateDouble(double doublevalue) {
+        return doublevalue * -1.0;
+    }
+
+	/**
+	 * @tests java.lang.Math#rint(double)
+	 */
+	public void test_rintD() {
+		// Test for method double java.lang.Math.rint(double)
+		assertEquals("Failed to round properly - up to odd",
+				3.0, Math.rint(2.9), 0D);
+		assertTrue("Failed to round properly - NaN", Double.isNaN(Math
+				.rint(Double.NaN)));
+		assertEquals("Failed to round properly down  to even",
+				2.0, Math.rint(2.1), 0D);
+		assertTrue("Failed to round properly " + 2.5 + " to even", Math
+				.rint(2.5) == 2.0);
+                assertTrue("Failed to round properly " + (+0.0d),
+                        Math.rint(+0.0d) == +0.0d);
+                assertTrue("Failed to round properly " + (-0.0d),
+                        Math.rint(-0.0d) == -0.0d);
+	}
+
+	/**
+	 * @tests java.lang.Math#round(double)
+	 */
+	public void test_roundD() {
+		// Test for method long java.lang.Math.round(double)
+		assertEquals("Incorrect rounding of a float", -91, Math.round(-90.89d));
+	}
+
+	/**
+	 * @tests java.lang.Math#round(float)
+	 */
+	public void test_roundF() {
+		// Test for method int java.lang.Math.round(float)
+		assertEquals("Incorrect rounding of a float", -91, Math.round(-90.89f));
+	}
+	
+	/**
+     * @tests {@link java.lang.Math#scalb(double, int)}
+     * @since 1.6
+     */
+    @SuppressWarnings("boxing")
+    public void test_scalb_DI() {
+        // result is normal
+        assertEquals(4.1422946304E7, Math.scalb(1.2345, 25));
+        assertEquals(3.679096698760986E-8, Math.scalb(1.2345, -25));
+        assertEquals(1.2345, Math.scalb(1.2345, 0));
+        assertEquals(7868514.304, Math.scalb(0.2345, 25));
+
+        double normal = Math.scalb(0.2345, -25);
+        assertEquals(6.98864459991455E-9, normal);
+        // precision kept
+        assertEquals(0.2345, Math.scalb(normal, 25));
+
+        assertEquals(0.2345, Math.scalb(0.2345, 0));
+        assertEquals(-4.1422946304E7, Math.scalb(-1.2345, 25));
+        assertEquals(-6.98864459991455E-9, Math.scalb(-0.2345, -25));
+        assertEquals(2.0, Math.scalb(Double.MIN_NORMAL / 2, 1024));
+        assertEquals(64.0, Math.scalb(Double.MIN_VALUE, 1080));
+        assertEquals(234, Math.getExponent(Math.scalb(1.0, 234)));
+        assertEquals(3.9999999999999996, Math.scalb(Double.MAX_VALUE,
+                Double.MIN_EXPONENT));
+
+        // result is near infinity
+        double halfMax = Math.scalb(1.0, Double.MAX_EXPONENT);
+        assertEquals(8.98846567431158E307, halfMax);
+        assertEquals(Double.MAX_VALUE, halfMax - Math.ulp(halfMax) + halfMax);
+        assertEquals(Double.POSITIVE_INFINITY, halfMax + halfMax);
+        assertEquals(1.7976931348623155E308, Math.scalb(1.0 - Math.ulp(1.0),
+                Double.MAX_EXPONENT + 1));
+        assertEquals(Double.POSITIVE_INFINITY, Math.scalb(1.0 - Math.ulp(1.0),
+                Double.MAX_EXPONENT + 2));
+
+        halfMax = Math.scalb(-1.0, Double.MAX_EXPONENT);
+        assertEquals(-8.98846567431158E307, halfMax);
+        assertEquals(-Double.MAX_VALUE, halfMax + Math.ulp(halfMax) + halfMax);
+        assertEquals(Double.NEGATIVE_INFINITY, halfMax + halfMax);
+
+        assertEquals(Double.POSITIVE_INFINITY, Math.scalb(0.345, 1234));
+        assertEquals(Double.POSITIVE_INFINITY, Math.scalb(44.345E102, 934));
+        assertEquals(Double.NEGATIVE_INFINITY, Math.scalb(-44.345E102, 934));
+
+        assertEquals(Double.POSITIVE_INFINITY, Math.scalb(
+                Double.MIN_NORMAL / 2, 4000));
+        assertEquals(Double.POSITIVE_INFINITY, Math.scalb(Double.MIN_VALUE,
+                8000));
+        assertEquals(Double.POSITIVE_INFINITY, Math.scalb(Double.MAX_VALUE, 1));
+        assertEquals(Double.POSITIVE_INFINITY, Math.scalb(
+                Double.POSITIVE_INFINITY, 0));
+        assertEquals(Double.POSITIVE_INFINITY, Math.scalb(
+                Double.POSITIVE_INFINITY, -1));
+        assertEquals(Double.NEGATIVE_INFINITY, Math.scalb(
+                Double.NEGATIVE_INFINITY, -1));
+        assertEquals(Double.NEGATIVE_INFINITY, Math.scalb(
+                Double.NEGATIVE_INFINITY, Double.MIN_EXPONENT));
+
+        // result is subnormal/zero
+        long posZeroBits = Double.doubleToLongBits(+0.0);
+        long negZeroBits = Double.doubleToLongBits(-0.0);
+        assertEquals(posZeroBits, Double.doubleToLongBits(Math.scalb(+0.0,
+                Integer.MAX_VALUE)));
+        assertEquals(posZeroBits, Double.doubleToLongBits(Math
+                .scalb(+0.0, -123)));
+        assertEquals(posZeroBits, Double.doubleToLongBits(Math.scalb(+0.0, 0)));
+        assertEquals(negZeroBits, Double
+                .doubleToLongBits(Math.scalb(-0.0, 123)));
+        assertEquals(negZeroBits, Double.doubleToLongBits(Math.scalb(-0.0,
+                Integer.MIN_VALUE)));
+
+        assertEquals(Double.MIN_VALUE, Math.scalb(1.0, -1074));
+        assertEquals(posZeroBits, Double.doubleToLongBits(Math
+                .scalb(1.0, -1075)));
+        assertEquals(negZeroBits, Double.doubleToLongBits(Math.scalb(-1.0,
+                -1075)));
+
+        // precision lost
+        assertEquals(Math.scalb(21.405, -1078), Math.scalb(21.405, -1079));
+        assertEquals(Double.MIN_VALUE, Math.scalb(21.405, -1079));
+        assertEquals(-Double.MIN_VALUE, Math.scalb(-21.405, -1079));
+        assertEquals(posZeroBits, Double.doubleToLongBits(Math.scalb(21.405,
+                -1080)));
+        assertEquals(negZeroBits, Double.doubleToLongBits(Math.scalb(-21.405,
+                -1080)));
+        assertEquals(posZeroBits, Double.doubleToLongBits(Math.scalb(
+                Double.MIN_VALUE, -1)));
+        assertEquals(negZeroBits, Double.doubleToLongBits(Math.scalb(
+                -Double.MIN_VALUE, -1)));
+        assertEquals(Double.MIN_VALUE, Math.scalb(Double.MIN_NORMAL, -52));
+        assertEquals(posZeroBits, Double.doubleToLongBits(Math.scalb(
+                Double.MIN_NORMAL, -53)));
+        assertEquals(negZeroBits, Double.doubleToLongBits(Math.scalb(
+                -Double.MIN_NORMAL, -53)));
+        assertEquals(Double.MIN_VALUE, Math.scalb(Double.MAX_VALUE, -2098));
+        assertEquals(posZeroBits, Double.doubleToLongBits(Math.scalb(
+                Double.MAX_VALUE, -2099)));
+        assertEquals(negZeroBits, Double.doubleToLongBits(Math.scalb(
+                -Double.MAX_VALUE, -2099)));
+        assertEquals(Double.MIN_VALUE, Math.scalb(Double.MIN_NORMAL / 3, -51));
+        assertEquals(posZeroBits, Double.doubleToLongBits(Math.scalb(
+                Double.MIN_NORMAL / 3, -52)));
+        assertEquals(negZeroBits, Double.doubleToLongBits(Math.scalb(
+                -Double.MIN_NORMAL / 3, -52)));
+        double subnormal = Math.scalb(Double.MIN_NORMAL / 3, -25);
+        assertEquals(2.2104123E-316, subnormal);
+        // precision lost
+        assertFalse(Double.MIN_NORMAL / 3 == Math.scalb(subnormal, 25));
+
+        // NaN
+        assertTrue(Double.isNaN(Math.scalb(Double.NaN, 1)));
+        assertTrue(Double.isNaN(Math.scalb(Double.NaN, 0)));
+        assertTrue(Double.isNaN(Math.scalb(Double.NaN, -120)));
+
+        assertEquals(1283457024, Double.doubleToLongBits(Math.scalb(
+                Double.MIN_VALUE * 153, 23)));
+        assertEquals(-9223372035571318784L, Double.doubleToLongBits(Math.scalb(
+                -Double.MIN_VALUE * 153, 23)));
+        assertEquals(36908406321184768L, Double.doubleToLongBits(Math.scalb(
+                Double.MIN_VALUE * 153, 52)));
+        assertEquals(-9186463630533591040L, Double.doubleToLongBits(Math.scalb(
+                -Double.MIN_VALUE * 153, 52)));
+
+        // test for exception
+        try {
+            Math.scalb((Double) null, (Integer) null);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
+        try {
+            Math.scalb(1.0, (Integer) null);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
+        try {
+            Math.scalb((Double) null, 1);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
         
-        assertEquals("pow returned incorrect value", Double.POSITIVE_INFINITY, 
-                                                               Math.pow(0, -1));
-        assertEquals("pow returned incorrect value", Double.POSITIVE_INFINITY, 
-                                         Math.pow(Double.POSITIVE_INFINITY, 1));
-        
-        assertEquals("pow returned incorrect value", 0.0, 
-                                                           Math.pow(-0.0, 0.9));
-        assertEquals("pow returned incorrect value", 0.0, 
-                                      Math.pow(Double.NEGATIVE_INFINITY, -0.9));
-        
-        assertEquals("pow returned incorrect value", -0.0, 
-                                                             Math.pow(-0.0, 1));
-        assertEquals("pow returned incorrect value", -0.0, 
-                                        Math.pow(Double.NEGATIVE_INFINITY, -1));  
-        
-        assertEquals("pow returned incorrect value", Double.POSITIVE_INFINITY, 
-                                                          Math.pow(-0.0, -0.9));
-        assertEquals("pow returned incorrect value", Double.POSITIVE_INFINITY, 
-                                       Math.pow(Double.NEGATIVE_INFINITY, 0.9));  
-        
-        assertEquals("pow returned incorrect value", Double.NEGATIVE_INFINITY, 
-                                                            Math.pow(-0.0, -1));
-        assertEquals("pow returned incorrect value", Double.NEGATIVE_INFINITY, 
-                                         Math.pow(Double.NEGATIVE_INFINITY, 1));   
-        
-        assertEquals("pow returned incorrect value", 0.81, Math.pow(-0.9, 2));  
-        assertEquals("pow returned incorrect value", -0.9, Math.pow(-0.9, 1)); 
-        assertEquals("pow returned incorrect value", Double.NaN, 
-                                                           Math.pow(-0.9, 0.1));
+        long b1em1022 = 0x0010000000000000L; // bit representation of
+                                                // Double.MIN_NORMAL
+        long b1em1023 = 0x0008000000000000L; // bit representation of half of
+                                                // Double.MIN_NORMAL
+        // assert exact identity
+        assertEquals(b1em1023, Double.doubleToLongBits(Math.scalb(Double
+                .longBitsToDouble(b1em1022), -1)));
     }
 
     /**
-     * @tests java.lang.Math#rint(double)
+     * @tests {@link java.lang.Math#scalb(float, int)}
+     * @since 1.6
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "rint",
-        args = {double.class}
-    )
-    public void test_rintD() {
-        // Test for method double java.lang.Math.rint(double)
-        assertEquals("Failed to round properly - up to odd",
-                3.0, Math.rint(2.9), 0D);
-        assertTrue("Failed to round properly - NaN", Double.isNaN(Math
-                .rint(Double.NaN)));
-        assertEquals("Failed to round properly down  to even",
-                2.0, Math.rint(2.1), 0D);
-        assertTrue("Failed to round properly " + 2.5 + " to even", Math
-                .rint(2.5) == 2.0);
-    }
+    @SuppressWarnings("boxing")
+    public void test_scalb_FI() {
+        // result is normal
+        assertEquals(4.1422946304E7f, Math.scalb(1.2345f, 25));
+        assertEquals(3.679096698760986E-8f, Math.scalb(1.2345f, -25));
+        assertEquals(1.2345f, Math.scalb(1.2345f, 0));
+        assertEquals(7868514.304f, Math.scalb(0.2345f, 25));
 
-    /**
-     * @tests java.lang.Math#round(double)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "round",
-        args = {double.class}
-    )
-    public void test_roundD() {
-        // Test for method long java.lang.Math.round(double)
-        assertEquals("Incorrect rounding of a float", -91, Math.round(-90.89d));
-        assertEquals("Incorrect rounding of a float", 0, 
-                                                        Math.round(Double.NaN));
-        assertEquals("Incorrect rounding of a float", Long.MIN_VALUE, 
-                                          Math.round(Double.NEGATIVE_INFINITY));
-        assertEquals("Incorrect rounding of a float", Long.MAX_VALUE, 
-                                          Math.round(Double.POSITIVE_INFINITY));        
-    }
+        float normal = Math.scalb(0.2345f, -25);
+        assertEquals(6.98864459991455E-9f, normal);
+        // precision kept
+        assertEquals(0.2345f, Math.scalb(normal, 25));
 
-    /**
-     * @tests java.lang.Math#round(float)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "round",
-        args = {float.class}
-    )
-    public void test_roundF() {
-        // Test for method int java.lang.Math.round(float)
-        assertEquals("Incorrect rounding of a float", -91, Math.round(-90.89f));
-        assertEquals("Incorrect rounding of a float", 0, 
-                                                        Math.round(Float.NaN));
-        assertEquals("Incorrect rounding of a float", Integer.MIN_VALUE, 
-                                          Math.round(Float.NEGATIVE_INFINITY));
-        assertEquals("Incorrect rounding of a float", Integer.MAX_VALUE, 
-                                          Math.round(Float.POSITIVE_INFINITY));          
+        assertEquals(0.2345f, Math.scalb(0.2345f, 0));
+        assertEquals(-4.1422946304E7f, Math.scalb(-1.2345f, 25));
+        assertEquals(-6.98864459991455E-9f, Math.scalb(-0.2345f, -25));
+        assertEquals(2.0f, Math.scalb(Float.MIN_NORMAL / 2, 128));
+        assertEquals(64.0f, Math.scalb(Float.MIN_VALUE, 155));
+        assertEquals(34, Math.getExponent(Math.scalb(1.0f, 34)));
+        assertEquals(3.9999998f, Math
+                .scalb(Float.MAX_VALUE, Float.MIN_EXPONENT));
+
+        // result is near infinity
+        float halfMax = Math.scalb(1.0f, Float.MAX_EXPONENT);
+        assertEquals(1.7014118E38f, halfMax);
+        assertEquals(Float.MAX_VALUE, halfMax - Math.ulp(halfMax) + halfMax);
+        assertEquals(Float.POSITIVE_INFINITY, halfMax + halfMax);
+        assertEquals(3.4028233E38f, Math.scalb(1.0f - Math.ulp(1.0f),
+                Float.MAX_EXPONENT + 1));
+        assertEquals(Float.POSITIVE_INFINITY, Math.scalb(1.0f - Math.ulp(1.0f),
+                Float.MAX_EXPONENT + 2));
+
+        halfMax = Math.scalb(-1.0f, Float.MAX_EXPONENT);
+        assertEquals(-1.7014118E38f, halfMax);
+        assertEquals(-Float.MAX_VALUE, halfMax + Math.ulp(halfMax) + halfMax);
+        assertEquals(Float.NEGATIVE_INFINITY, halfMax + halfMax);
+
+        assertEquals(Float.POSITIVE_INFINITY, Math.scalb(0.345f, 1234));
+        assertEquals(Float.POSITIVE_INFINITY, Math.scalb(44.345E10f, 934));
+        assertEquals(Float.NEGATIVE_INFINITY, Math.scalb(-44.345E10f, 934));
+
+        assertEquals(Float.POSITIVE_INFINITY, Math.scalb(Float.MIN_NORMAL / 2,
+                400));
+        assertEquals(Float.POSITIVE_INFINITY, Math.scalb(Float.MIN_VALUE, 800));
+        assertEquals(Float.POSITIVE_INFINITY, Math.scalb(Float.MAX_VALUE, 1));
+        assertEquals(Float.POSITIVE_INFINITY, Math.scalb(
+                Float.POSITIVE_INFINITY, 0));
+        assertEquals(Float.POSITIVE_INFINITY, Math.scalb(
+                Float.POSITIVE_INFINITY, -1));
+        assertEquals(Float.NEGATIVE_INFINITY, Math.scalb(
+                Float.NEGATIVE_INFINITY, -1));
+        assertEquals(Float.NEGATIVE_INFINITY, Math.scalb(
+                Float.NEGATIVE_INFINITY, Float.MIN_EXPONENT));
+
+        // result is subnormal/zero
+        int posZeroBits = Float.floatToIntBits(+0.0f);
+        int negZeroBits = Float.floatToIntBits(-0.0f);
+        assertEquals(posZeroBits, Float.floatToIntBits(Math.scalb(+0.0f,
+                Integer.MAX_VALUE)));
+        assertEquals(posZeroBits, Float.floatToIntBits(Math.scalb(+0.0f, -123)));
+        assertEquals(posZeroBits, Float.floatToIntBits(Math.scalb(+0.0f, 0)));
+        assertEquals(negZeroBits, Float.floatToIntBits(Math.scalb(-0.0f, 123)));
+        assertEquals(negZeroBits, Float.floatToIntBits(Math.scalb(-0.0f,
+                Integer.MIN_VALUE)));
+
+        assertEquals(Float.MIN_VALUE, Math.scalb(1.0f, -149));
+        assertEquals(posZeroBits, Float.floatToIntBits(Math.scalb(1.0f, -150)));
+        assertEquals(negZeroBits, Float.floatToIntBits(Math.scalb(-1.0f, -150)));
+
+        // precision lost
+        assertEquals(Math.scalb(21.405f, -154), Math.scalb(21.405f, -153));
+        assertEquals(Float.MIN_VALUE, Math.scalb(21.405f, -154));
+        assertEquals(-Float.MIN_VALUE, Math.scalb(-21.405f, -154));
+        assertEquals(posZeroBits, Float.floatToIntBits(Math
+                .scalb(21.405f, -155)));
+        assertEquals(negZeroBits, Float.floatToIntBits(Math.scalb(-21.405f,
+                -155)));
+        assertEquals(posZeroBits, Float.floatToIntBits(Math.scalb(
+                Float.MIN_VALUE, -1)));
+        assertEquals(negZeroBits, Float.floatToIntBits(Math.scalb(
+                -Float.MIN_VALUE, -1)));
+        assertEquals(Float.MIN_VALUE, Math.scalb(Float.MIN_NORMAL, -23));
+        assertEquals(posZeroBits, Float.floatToIntBits(Math.scalb(
+                Float.MIN_NORMAL, -24)));
+        assertEquals(negZeroBits, Float.floatToIntBits(Math.scalb(
+                -Float.MIN_NORMAL, -24)));
+        assertEquals(Float.MIN_VALUE, Math.scalb(Float.MAX_VALUE, -277));
+        assertEquals(posZeroBits, Float.floatToIntBits(Math.scalb(
+                Float.MAX_VALUE, -278)));
+        assertEquals(negZeroBits, Float.floatToIntBits(Math.scalb(
+                -Float.MAX_VALUE, -278)));
+        assertEquals(Float.MIN_VALUE, Math.scalb(Float.MIN_NORMAL / 3, -22));
+        assertEquals(posZeroBits, Float.floatToIntBits(Math.scalb(
+                Float.MIN_NORMAL / 3, -23)));
+        assertEquals(negZeroBits, Float.floatToIntBits(Math.scalb(
+                -Float.MIN_NORMAL / 3, -23)));
+        float subnormal = Math.scalb(Float.MIN_NORMAL / 3, -11);
+        assertEquals(1.913E-42f, subnormal);
+        // precision lost
+        assertFalse(Float.MIN_NORMAL / 3 == Math.scalb(subnormal, 11));
+
+        assertEquals(68747264, Float.floatToIntBits(Math.scalb(
+                Float.MIN_VALUE * 153, 23)));
+        assertEquals(-2078736384, Float.floatToIntBits(Math.scalb(
+                -Float.MIN_VALUE * 153, 23)));
+
+        assertEquals(4896, Float.floatToIntBits(Math.scalb(
+                Float.MIN_VALUE * 153, 5)));
+        assertEquals(-2147478752, Float.floatToIntBits(Math.scalb(
+                -Float.MIN_VALUE * 153, 5)));
+
+        // NaN
+        assertTrue(Float.isNaN(Math.scalb(Float.NaN, 1)));
+        assertTrue(Float.isNaN(Math.scalb(Float.NaN, 0)));
+        assertTrue(Float.isNaN(Math.scalb(Float.NaN, -120)));
+
+        // test for exception
+        try {
+            Math.scalb((Float) null, (Integer) null);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
+        try {
+            Math.scalb(1.0f, (Integer) null);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
+        try {
+            Math.scalb((Float) null, 1);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
+        
+        int b1em126 = 0x00800000; // bit representation of Float.MIN_NORMAL
+        int b1em127 = 0x00400000; // bit representation of half
+                                    // Float.MIN_NORMAL
+        // assert exact identity
+        assertEquals(b1em127, Float.floatToIntBits(Math.scalb(Float
+                .intBitsToFloat(b1em126), -1)));
     }
     
     /**
      * @tests java.lang.Math#signum(double)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "signum",
-        args = {double.class}
-    )
     public void test_signum_D() {
         assertTrue(Double.isNaN(Math.signum(Double.NaN)));
         assertTrue(Double.isNaN(Math.signum(Double.NaN)));
@@ -955,12 +1668,6 @@
     /**
      * @tests java.lang.Math#signum(float)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "signum",
-        args = {float.class}
-    )
     public void test_signum_F() {
         assertTrue(Float.isNaN(Math.signum(Float.NaN)));
         assertEquals(Float.floatToIntBits(0.0f), Float
@@ -983,40 +1690,18 @@
         assertEquals(-1.0f, Math.signum(Float.NEGATIVE_INFINITY), 0f);
     }
 
-    /**
+	/**
      * @tests java.lang.Math#sin(double)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "sin",
-        args = {double.class}
-    )
-    public void test_sinD() {
-        // Test for method double java.lang.Math.sin(double)
-        assertEquals("Incorrect answer", 0.0, Math.sin(0), 0D);
-        assertEquals("Incorrect answer", 0.8414709848078965, Math.sin(1), 0D);
-        
-        double [] args = {Double.NaN, Double.POSITIVE_INFINITY, 
-                          Double.NEGATIVE_INFINITY};
-        for(int i = 0; i < args.length; i++) {
-            assertEquals("Incorrest returned value.", Double.NaN, 
-                                                             Math.sin(args[i]));
-        }
-        
-        assertEquals("Incorrest returned value.", 0.0, Math.sin(0.0));
-        assertEquals("Incorrest returned value.", -0.0, Math.sin(-0.0));        
-    }
+	public void test_sinD() {
+		// Test for method double java.lang.Math.sin(double)
+		assertEquals("Incorrect answer", 0.0, Math.sin(0), 0D);
+		assertEquals("Incorrect answer", 0.8414709848078965, Math.sin(1), 0D);
+	}
     
     /**
      * @tests java.lang.Math#sinh(double)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "sinh",
-        args = {double.class}
-    )
     public void test_sinh_D() {
         // Test for special situations
         assertTrue("Should return NaN", Double.isNaN(Math.sinh(Double.NaN)));
@@ -1025,11 +1710,11 @@
         assertEquals("Should return NEGATIVE_INFINITY",
                 Double.NEGATIVE_INFINITY, Math.sinh(Double.NEGATIVE_INFINITY), 0D);
         assertEquals(Double.doubleToLongBits(0.0), Double.doubleToLongBits(Math
-                .sinh(0.0)));
-        assertEquals(Double.doubleToLongBits(+0.0), Double
-                .doubleToLongBits(Math.sinh(+0.0)));
-        assertEquals(Double.doubleToLongBits(-0.0), Double
-                .doubleToLongBits(Math.sinh(-0.0)));
+				.sinh(0.0)));
+		assertEquals(Double.doubleToLongBits(+0.0), Double
+				.doubleToLongBits(Math.sinh(+0.0)));
+		assertEquals(Double.doubleToLongBits(-0.0), Double
+				.doubleToLongBits(Math.sinh(-0.0)));
 
         assertEquals("Should return POSITIVE_INFINITY",
                 Double.POSITIVE_INFINITY, Math.sinh(1234.56), 0D);
@@ -1047,62 +1732,27 @@
                 .sinh(Double.MIN_VALUE), 0D);
     }
     
-    /**
-     * @tests java.lang.Math#sqrt(double)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "sqrt",
-        args = {double.class}
-    )
-    public void test_sqrtD() {
-        // Test for method double java.lang.Math.sqrt(double)
-        assertEquals("Incorrect root returned2", 7, Math.sqrt(49), 0);
-        assertEquals("Incorrect value is returned", Double.NaN, 
-                                                         Math.sqrt(Double.NaN));
-        assertEquals("Incorrect value is returned", Double.NaN, 
-                                                                 Math.sqrt(-1)); 
-        assertEquals("Incorrect value is returned", Double.POSITIVE_INFINITY, 
-                                           Math.sqrt(Double.POSITIVE_INFINITY));
-        assertEquals("Incorrect value is returned", 0.0, Math.sqrt(0.0));         
-        assertEquals("Incorrect value is returned", -0.0, Math.sqrt(-0.0));        
-    }
+	/**
+	 * @tests java.lang.Math#sqrt(double)
+	 */
+	public void test_sqrtD() {
+		// Test for method double java.lang.Math.sqrt(double)
+                assertEquals("Incorrect root returned2", 7, Math.sqrt(49), 0);
+	}
 
-    /**
-     * @tests java.lang.Math#tan(double)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "tan",
-        args = {double.class}
-    )
-    public void test_tanD() {
-        // Test for method double java.lang.Math.tan(double)
-        assertEquals("Incorrect answer", 0.0, Math.tan(0), 0D);
-        assertEquals("Incorrect answer", 1.5574077246549023, Math.tan(1), 0D);
+	/**
+	 * @tests java.lang.Math#tan(double)
+	 */
+	public void test_tanD() {
+		// Test for method double java.lang.Math.tan(double)
+		assertEquals("Incorrect answer", 0.0, Math.tan(0), 0D);
+		assertEquals("Incorrect answer", 1.5574077246549023, Math.tan(1), 0D);
 
-        double [] args = {Double.NaN, Double.POSITIVE_INFINITY, 
-                                                      Double.NEGATIVE_INFINITY};
-        for(int i = 0; i < args.length; i++) {
-            assertEquals("Incorrest returned value.", Double.NaN, 
-                                                   Math.tan(args[i]));
-        }
-        
-        assertEquals("Incorrest returned value.", 0.0, Math.tan(0.0));
-        assertEquals("Incorrest returned value.", -0.0, Math.tan(-0.0));        
-    }
+	}
 
     /**
      * @tests java.lang.Math#tanh(double)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "tanh",
-        args = {double.class}
-    )
     public void test_tanh_D() {
         // Test for special situations
         assertTrue("Should return NaN", Double.isNaN(Math.tanh(Double.NaN)));
@@ -1111,11 +1761,11 @@
         assertEquals("Should return -1.0", -1.0, Math
                 .tanh(Double.NEGATIVE_INFINITY), 0D);
         assertEquals(Double.doubleToLongBits(0.0), Double.doubleToLongBits(Math
-                .tanh(0.0)));
-        assertEquals(Double.doubleToLongBits(+0.0), Double
-                .doubleToLongBits(Math.tanh(+0.0)));
-        assertEquals(Double.doubleToLongBits(-0.0), Double
-                .doubleToLongBits(Math.tanh(-0.0)));
+				.tanh(0.0)));
+		assertEquals(Double.doubleToLongBits(+0.0), Double
+				.doubleToLongBits(Math.tanh(+0.0)));
+		assertEquals(Double.doubleToLongBits(-0.0), Double
+				.doubleToLongBits(Math.tanh(-0.0)));
 
         assertEquals("Should return 1.0", 1.0, Math.tanh(1234.56), 0D);
         assertEquals("Should return -1.0", -1.0, Math.tanh(-1234.56), 0D);
@@ -1128,144 +1778,210 @@
                 .tanh(Double.MIN_VALUE), 0D);
     }
     
-    /**
-     * @tests java.lang.Math#random()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "random",
-        args = {}
-    )
-    public void test_random() {
-        // There isn't a place for these tests so just stick them here
-        assertEquals("Wrong value E",
-                4613303445314885481L, Double.doubleToLongBits(Math.E));
-        assertEquals("Wrong value PI",
-                4614256656552045848L, Double.doubleToLongBits(Math.PI));
+	/**
+	 * @tests java.lang.Math#random()
+	 */
+	public void test_random() {
+		// There isn't a place for these tests so just stick them here
+		assertEquals("Wrong value E",
+				4613303445314885481L, Double.doubleToLongBits(Math.E));
+		assertEquals("Wrong value PI",
+				4614256656552045848L, Double.doubleToLongBits(Math.PI));
 
-        for (int i = 500; i >= 0; i--) {
-            double d = Math.random();
-            assertTrue("Generated number is out of range: " + d, d >= 0.0
-                    && d < 1.0);
-        }
-    }
+		for (int i = 500; i >= 0; i--) {
+			double d = Math.random();
+			assertTrue("Generated number is out of range: " + d, d >= 0.0
+					&& d < 1.0);
+		}
+	}
 
-    /**
-     * @tests java.lang.Math#toRadians(double)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toRadians",
-        args = {double.class}
-    )
-    public void test_toRadiansD() {
-        for (double d = 500; d >= 0; d -= 1.0) {
-            double converted = Math.toDegrees(Math.toRadians(d));
-            assertTrue("Converted number not equal to original. d = " + d,
-                    converted >= d * 0.99999999 && converted <= d * 1.00000001);
-        }
-    }
+	/**
+	 * @tests java.lang.Math#toRadians(double)
+	 */
+	public void test_toRadiansD() {
+		for (double d = 500; d >= 0; d -= 1.0) {
+			double converted = Math.toDegrees(Math.toRadians(d));
+			assertTrue("Converted number not equal to original. d = " + d,
+					converted >= d * 0.99999999 && converted <= d * 1.00000001);
+		}
+	}
 
-    /**
-     * @tests java.lang.Math#toDegrees(double)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toDegrees",
-        args = {double.class}
-    )
-    public void test_toDegreesD() {
-        for (double d = 500; d >= 0; d -= 1.0) {
-            double converted = Math.toRadians(Math.toDegrees(d));
-            assertTrue("Converted number not equal to original. d = " + d,
-                    converted >= d * 0.99999999 && converted <= d * 1.00000001);
-        }
-    }
-    
-    /**
+	/**
+	 * @tests java.lang.Math#toDegrees(double)
+	 */
+	public void test_toDegreesD() {
+		for (double d = 500; d >= 0; d -= 1.0) {
+			double converted = Math.toRadians(Math.toDegrees(d));
+			assertTrue("Converted number not equal to original. d = " + d,
+					converted >= d * 0.99999999 && converted <= d * 1.00000001);
+		}
+	}
+	
+	/**
      * @tests java.lang.Math#ulp(double)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "ulp",
-        args = {double.class}
-    )
     @SuppressWarnings("boxing")
     public void test_ulp_D() {
-        // Test for special cases
-        assertTrue("Should return NaN", Double.isNaN(Math.ulp(Double.NaN)));
-        assertEquals("Returned incorrect value", Double.POSITIVE_INFINITY, Math
-                .ulp(Double.POSITIVE_INFINITY), 0D);
-        assertEquals("Returned incorrect value", Double.POSITIVE_INFINITY, Math
-                .ulp(Double.NEGATIVE_INFINITY), 0D);
-        assertEquals("Returned incorrect value", Double.MIN_VALUE, Math
-                .ulp(0.0), 0D);
-        assertEquals("Returned incorrect value", Double.MIN_VALUE, Math
-                .ulp(+0.0), 0D);
-        assertEquals("Returned incorrect value", Double.MIN_VALUE, Math
-                .ulp(-0.0), 0D);
-        assertEquals("Returned incorrect value", Math.pow(2, 971), Math
-                .ulp(Double.MAX_VALUE), 0D);
-        assertEquals("Returned incorrect value", Math.pow(2, 971), Math
-                .ulp(-Double.MAX_VALUE), 0D);
+		// Test for special cases
+		assertTrue("Should return NaN", Double.isNaN(Math.ulp(Double.NaN)));
+		assertEquals("Returned incorrect value", Double.POSITIVE_INFINITY, Math
+				.ulp(Double.POSITIVE_INFINITY), 0D);
+		assertEquals("Returned incorrect value", Double.POSITIVE_INFINITY, Math
+				.ulp(Double.NEGATIVE_INFINITY), 0D);
+		assertEquals("Returned incorrect value", Double.MIN_VALUE, Math
+				.ulp(0.0), 0D);
+		assertEquals("Returned incorrect value", Double.MIN_VALUE, Math
+				.ulp(+0.0), 0D);
+		assertEquals("Returned incorrect value", Double.MIN_VALUE, Math
+				.ulp(-0.0), 0D);
+		assertEquals("Returned incorrect value", Math.pow(2, 971), Math
+				.ulp(Double.MAX_VALUE), 0D);
+		assertEquals("Returned incorrect value", Math.pow(2, 971), Math
+				.ulp(-Double.MAX_VALUE), 0D);
 
-        assertEquals("Returned incorrect value", Double.MIN_VALUE, Math
-                .ulp(Double.MIN_VALUE), 0D);
-        assertEquals("Returned incorrect value", Double.MIN_VALUE, Math
-                .ulp(-Double.MIN_VALUE), 0D);
+		assertEquals("Returned incorrect value", Double.MIN_VALUE, Math
+				.ulp(Double.MIN_VALUE), 0D);
+		assertEquals("Returned incorrect value", Double.MIN_VALUE, Math
+				.ulp(-Double.MIN_VALUE), 0D);
 
-        assertEquals("Returned incorrect value", 2.220446049250313E-16, Math
-                .ulp(1.0), 0D);
-        assertEquals("Returned incorrect value", 2.220446049250313E-16, Math
-                .ulp(-1.0), 0D);
-        assertEquals("Returned incorrect value", 2.2737367544323206E-13, Math
-                .ulp(1153.0), 0D);
+		assertEquals("Returned incorrect value", 2.220446049250313E-16, Math
+				.ulp(1.0), 0D);
+		assertEquals("Returned incorrect value", 2.220446049250313E-16, Math
+				.ulp(-1.0), 0D);
+		assertEquals("Returned incorrect value", 2.2737367544323206E-13, Math
+				.ulp(1153.0), 0D);
+	}
+
+	/**
+	 * @tests java.lang.Math#ulp(float)
+	 */
+	@SuppressWarnings("boxing")
+	public void test_ulp_f() {
+		// Test for special cases
+		assertTrue("Should return NaN", Float.isNaN(Math.ulp(Float.NaN)));
+		assertEquals("Returned incorrect value", Float.POSITIVE_INFINITY, Math
+				.ulp(Float.POSITIVE_INFINITY), 0f);
+		assertEquals("Returned incorrect value", Float.POSITIVE_INFINITY, Math
+				.ulp(Float.NEGATIVE_INFINITY), 0f);
+		assertEquals("Returned incorrect value", Float.MIN_VALUE, Math
+				.ulp(0.0f), 0f);
+		assertEquals("Returned incorrect value", Float.MIN_VALUE, Math
+				.ulp(+0.0f), 0f);
+		assertEquals("Returned incorrect value", Float.MIN_VALUE, Math
+				.ulp(-0.0f), 0f);
+		assertEquals("Returned incorrect value", 2.028241E31f, Math
+				.ulp(Float.MAX_VALUE), 0f);
+		assertEquals("Returned incorrect value", 2.028241E31f, Math
+				.ulp(-Float.MAX_VALUE), 0f);
+
+		assertEquals("Returned incorrect value", 1.4E-45f, Math
+				.ulp(Float.MIN_VALUE), 0f);
+		assertEquals("Returned incorrect value", 1.4E-45f, Math
+				.ulp(-Float.MIN_VALUE), 0f);
+
+		assertEquals("Returned incorrect value", 1.1920929E-7f, Math.ulp(1.0f),
+				0f);
+		assertEquals("Returned incorrect value", 1.1920929E-7f,
+				Math.ulp(-1.0f), 0f);
+		assertEquals("Returned incorrect value", 1.2207031E-4f, Math
+				.ulp(1153.0f), 0f);
+		assertEquals("Returned incorrect value", 5.6E-45f, Math
+				.ulp(9.403954E-38f), 0f);
+    }
+	
+	/**
+     * @tests {@link java.lang.Math#shiftIntBits(int, int)}
+     * 
+     * @since 1.6 
+     */
+    public void test_shiftIntBits_II() {
+        class Tuple {
+            public int result;
+
+            public int value;
+
+            public int factor;
+
+            public Tuple(int result, int value, int factor) {
+                this.result = result;
+                this.value = value;
+                this.factor = factor;
+            }
+        }
+        final Tuple[] TUPLES = new Tuple[] {
+        // sub-normal to sub-normal
+                new Tuple(0x00000000, 0x00000001, -1),
+                // round to even
+                new Tuple(0x00000002, 0x00000003, -1),
+                // round to even
+                new Tuple(0x00000001, 0x00000005, -3),
+                // round to infinity
+                new Tuple(0x00000002, 0x0000000d, -3),
+                // round to infinity
+
+                // normal to sub-normal
+                new Tuple(0x00000002, 0x01a00000, -24),
+                // round to even 
+                new Tuple(0x00000004, 0x01e00000, -24),
+                // round to even
+                new Tuple(0x00000003, 0x01c80000, -24),
+                // round to infinity
+                new Tuple(0x00000004, 0x01e80000, -24),
+        // round to infinity
+        };
+        for (int i = 0; i < TUPLES.length; ++i) {
+            Tuple tuple = TUPLES[i];
+            assertEquals(tuple.result, Float.floatToIntBits(Math.scalb(Float
+                    .intBitsToFloat(tuple.value), tuple.factor)));
+            assertEquals(tuple.result, Float.floatToIntBits(-Math.scalb(-Float
+                    .intBitsToFloat(tuple.value), tuple.factor)));
+        }
     }
 
     /**
-     * @tests java.lang.Math#ulp(float)
+     * @tests {@link java.lang.Math#shiftLongBits(long, long)}
+     * 
+     * Round result to nearest value on precision lost.
+     * 
+     * @since 1.6 
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "ulp",
-        args = {float.class}
-    )
-    @SuppressWarnings("boxing")
-    public void test_ulp_f() {
-        // Test for special cases
-        assertTrue("Should return NaN", Float.isNaN(Math.ulp(Float.NaN)));
-        assertEquals("Returned incorrect value", Float.POSITIVE_INFINITY, Math
-                .ulp(Float.POSITIVE_INFINITY), 0f);
-        assertEquals("Returned incorrect value", Float.POSITIVE_INFINITY, Math
-                .ulp(Float.NEGATIVE_INFINITY), 0f);
-        assertEquals("Returned incorrect value", Float.MIN_VALUE, Math
-                .ulp(0.0f), 0f);
-        assertEquals("Returned incorrect value", Float.MIN_VALUE, Math
-                .ulp(+0.0f), 0f);
-        assertEquals("Returned incorrect value", Float.MIN_VALUE, Math
-                .ulp(-0.0f), 0f);
-        assertEquals("Returned incorrect value", 2.028241E31f, Math
-                .ulp(Float.MAX_VALUE), 0f);
-        assertEquals("Returned incorrect value", 2.028241E31f, Math
-                .ulp(-Float.MAX_VALUE), 0f);
+    public void test_shiftLongBits_LL() {
+        class Tuple {
+            public long result;
 
-        assertEquals("Returned incorrect value", 1.4E-45f, Math
-                .ulp(Float.MIN_VALUE), 0f);
-        assertEquals("Returned incorrect value", 1.4E-45f, Math
-                .ulp(-Float.MIN_VALUE), 0f);
+            public long value;
 
-        assertEquals("Returned incorrect value", 1.1920929E-7f, Math.ulp(1.0f),
-                0f);
-        assertEquals("Returned incorrect value", 1.1920929E-7f,
-                Math.ulp(-1.0f), 0f);
-        assertEquals("Returned incorrect value", 1.2207031E-4f, Math
-                .ulp(1153.0f), 0f);
-        assertEquals("Returned incorrect value", 5.6E-45f, Math
-                .ulp(9.403954E-38f), 0f);
+            public int factor;
+
+            public Tuple(long result, long value, int factor) {
+                this.result = result;
+                this.value = value;
+                this.factor = factor;
+            }
+        }
+        final Tuple[] TUPLES = new Tuple[] {
+        // sub-normal to sub-normal
+                new Tuple(0x00000000L, 0x00000001L, -1),
+                //round to even
+                new Tuple(0x00000002L, 0x00000003L, -1),
+                //round to even
+                new Tuple(0x00000001L, 0x00000005L, -3),
+                //round to infinity
+                new Tuple(0x00000002L, 0x0000000dL, -3),
+                //round to infinity
+
+                // normal to sub-normal
+                new Tuple(0x0000000000000002L, 0x0034000000000000L, -53), // round to even
+                new Tuple(0x0000000000000004L, 0x003c000000000000L, -53), // round to even
+                new Tuple(0x0000000000000003L, 0x0035000000000000L, -53), // round to infinity
+                new Tuple(0x0000000000000004L, 0x003d000000000000L, -53), // round to infinity
+        };
+        for (int i = 0; i < TUPLES.length; ++i) {
+            Tuple tuple = TUPLES[i];
+            assertEquals(tuple.result, Double.doubleToLongBits(Math.scalb(
+                    Double.longBitsToDouble(tuple.value), tuple.factor)));
+            assertEquals(tuple.result, Double.doubleToLongBits(-Math.scalb(
+                    -Double.longBitsToDouble(tuple.value), tuple.factor)));
+        }
     }
 }
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/StrictMathTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/StrictMathTest.java
index 137676c..831dbf8 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/StrictMathTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/StrictMathTest.java
@@ -17,369 +17,113 @@
 
 package org.apache.harmony.luni.tests.java.lang;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
+import static org.apache.harmony.luni.tests.java.lang.MathTest.COPYSIGN_DD_CASES;
+import static org.apache.harmony.luni.tests.java.lang.MathTest.COPYSIGN_FF_CASES;
+import static org.apache.harmony.luni.tests.java.lang.MathTest.GETEXPONENT_D_CASES;
+import static org.apache.harmony.luni.tests.java.lang.MathTest.GETEXPONENT_D_RESULTS;
+import static org.apache.harmony.luni.tests.java.lang.MathTest.GETEXPONENT_F_CASES;
+import static org.apache.harmony.luni.tests.java.lang.MathTest.GETEXPONENT_F_RESULTS;
+import static org.apache.harmony.luni.tests.java.lang.MathTest.NEXTAFTER_DD_START_CASES;
+import static org.apache.harmony.luni.tests.java.lang.MathTest.NEXTAFTER_DD_FD_DIRECTION_CASES;
+import static org.apache.harmony.luni.tests.java.lang.MathTest.NEXTAFTER_FD_START_CASES;
 
-@TestTargetClass(StrictMath.class) 
 public class StrictMathTest extends junit.framework.TestCase {
 
-    double HYP = StrictMath.sqrt(2.0);
+	double HYP = StrictMath.sqrt(2.0);
 
-    double OPP = 1.0;
+	double OPP = 1.0;
 
-    double ADJ = 1.0;
+	double ADJ = 1.0;
 
-    /* Required to make previous preprocessor flags work - do not remove */
-    int unused = 0;
+	/* Required to make previous preprocessor flags work - do not remove */
+	int unused = 0;
 
-    /**
-     * @tests java.lang.StrictMath#pow(double)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "pow",
-        args = {double.class, double.class}
-    )
-    public void test_pow() {
-        // tests changes in fdlibm5.3
-        assertTrue(Double.longBitsToDouble(-4610068591539890326L) == 
-            StrictMath.pow(-1.0000000000000002e+00,4.5035996273704970e+15));
-        assertTrue(Double.longBitsToDouble( 4601023824101950163L) == 
-            StrictMath.pow(-9.9999999999999978e-01,4.035996273704970e+15));
-        
-        assertEquals("Incorrect value was returned.", 1.0, 
-                StrictMath.pow(Double.MAX_VALUE, 0.0));
-        assertEquals("Incorrect value was returned.", 1.0, 
-                StrictMath.pow(Double.MAX_VALUE, -0.0));
-        assertEquals("Incorrect value was returned.", Double.NaN, 
-                StrictMath.pow(Double.MAX_VALUE, Double.NaN)); 
-        assertEquals("Incorrect value was returned.", Double.NaN, 
-                StrictMath.pow(Double.NaN, 1.0));
-        assertEquals("Incorrect value was returned.", Double.POSITIVE_INFINITY, 
-                StrictMath.pow(1.1, Double.POSITIVE_INFINITY));    
-        assertEquals("Incorrect value was returned.", Double.POSITIVE_INFINITY, 
-                StrictMath.pow(0.9, Double.NEGATIVE_INFINITY));   
-        
-        assertEquals("Incorrect value was returned.", 0.0, 
-                StrictMath.pow(1.1, Double.NEGATIVE_INFINITY));   
-        assertEquals("Incorrect value was returned.", 0.0, 
-                StrictMath.pow(0.9, Double.POSITIVE_INFINITY));    
-        
-        assertEquals("Incorrect value was returned.", Double.NaN, 
-                StrictMath.pow(-1.0, Double.POSITIVE_INFINITY));   
-        assertEquals("Incorrect value was returned.", Double.NaN, 
-                StrictMath.pow(1.0, Double.NEGATIVE_INFINITY));
-        
-        assertEquals("Incorrect value was returned.", 0.0, 
-                StrictMath.pow(0.0, 1.1));   
-        assertEquals("Incorrect value was returned.", 0.0, 
-                StrictMath.pow(Double.POSITIVE_INFINITY, -1.0));   
-        
-        assertEquals("Incorrect value was returned.", 0.0, 
-                StrictMath.pow(-0.0, 1.1));   
-        assertEquals("Incorrect value was returned.", 0.0, 
-                StrictMath.pow(Double.POSITIVE_INFINITY, -1.0)); 
-        
-        assertEquals("Incorrect value was returned.", Double.POSITIVE_INFINITY,
-                StrictMath.pow(0.0, -1.0));
-        assertEquals("Incorrect value was returned.", Double.POSITIVE_INFINITY,
-                StrictMath.pow(Double.POSITIVE_INFINITY, 1.0));        
-        
-        assertEquals("Incorrect value was returned.", 0.0,
-                StrictMath.pow(-0.0, 2.0));
-        assertEquals("Incorrect value was returned.", 0.0,
-                StrictMath.pow(Double.NEGATIVE_INFINITY, -2.0));  
-        
-        assertEquals("Incorrect value was returned.", -0.0,
-                StrictMath.pow(-0.0, 1.0));
-        assertEquals("Incorrect value was returned.", -0.0,
-                StrictMath.pow(Double.NEGATIVE_INFINITY, -1.0));  
-        
-        assertEquals("Incorrect value was returned.", Double.POSITIVE_INFINITY,
-                StrictMath.pow(-0.0, -2.0));
-        assertEquals("Incorrect value was returned.", Double.POSITIVE_INFINITY,
-                StrictMath.pow(Double.NEGATIVE_INFINITY, 2.0)); 
-        
-        assertEquals("Incorrect value was returned.", Double.NEGATIVE_INFINITY,
-                StrictMath.pow(-0.0, -1.0));
-        assertEquals("Incorrect value was returned.", Double.NEGATIVE_INFINITY,
-                StrictMath.pow(Double.NEGATIVE_INFINITY, 1.0));   
-        
-        assertEquals("Incorrect value was returned.", -0.999,
-                StrictMath.pow(-0.999, 1.0));   
-        
-        assertEquals("Incorrect value was returned.", Double.NaN,
-                StrictMath.pow(-0.999, 1.1));
-    }
+	/**
+	 * @tests java.lang.StrictMath#abs(double)
+	 */
+	public void test_absD() {
+		// Test for method double java.lang.StrictMath.abs(double)
 
-    /**
-     * @tests java.lang.StrictMath#tan(double)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "tan",
-        args = {double.class}
-    )
-    public void test_tan(){
-        // tests changes in fdlibm5.3
-        assertTrue(Double.longBitsToDouble( 4850236541654588678L) == StrictMath.tan( 1.7765241907548024E+269));
-        assertEquals("Incorrect value of tan was returned.",
-                Double.NaN, StrictMath.tan(Double.NaN));
-        assertEquals("Incorrect value of tan was returned.",
-                Double.NaN, StrictMath.tan(Double.POSITIVE_INFINITY));     
-        assertEquals("Incorrect value of tan was returned.",
-                Double.NaN, StrictMath.tan(Double.NEGATIVE_INFINITY));
-        assertEquals("Incorrect value of tan was returned.",
-                0.0, StrictMath.tan(0.0));    
-        assertEquals("Incorrect value of tan was returned.",
-                -0.0, StrictMath.tan(-0.0));            
-    }
+		assertTrue("Incorrect double abs value",
+				(StrictMath.abs(-1908.8976) == 1908.8976));
+		assertTrue("Incorrect double abs value",
+				(StrictMath.abs(1908.8976) == 1908.8976));
+	}
 
-    /**
-     * @tests java.lang.StrictMath#asin(double)
-     * @tests java.lang.StrictMath#exp(double)
-     * @tests java.lang.StrictMath#sinh(double)
-     * @tests java.lang.StrictMath#expm1(double)
-     */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Checks one value.",
-            method = "asin",
-            args = {double.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Checks one value.",
-            method = "exp",
-            args = {double.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Checks one value.",
-            method = "sinh",
-            args = {double.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Checks one value.",
-            method = "expm1",
-            args = {double.class}
-        )
-    })
-    public void test_inexact(){
-        assertTrue( 4485585228743840298L == Double.doubleToRawLongBits(StrictMath.asin(7.4505805E-9)));
-        assertTrue( 4607182418816794624L == Double.doubleToRawLongBits(StrictMath.exp(3.7252902E-9)));
-        assertTrue( 4481081628995577220L == Double.doubleToRawLongBits(StrictMath.sinh(3.7252902E-9)));
-        assertTrue(-4616189618054758400L == Double.doubleToRawLongBits(StrictMath.expm1(-40)));
-    }
-    
-    /**
-     * @tests java.lang.StrictMath#abs(double)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "abs",
-        args = {double.class}
-    )
-    public void test_absD() {
-        // Test for method double java.lang.StrictMath.abs(double)
+	/**
+	 * @tests java.lang.StrictMath#abs(float)
+	 */
+	public void test_absF() {
+		// Test for method float java.lang.StrictMath.abs(float)
+		assertTrue("Incorrect float abs value",
+				(StrictMath.abs(-1908.8976f) == 1908.8976f));
+		assertTrue("Incorrect float abs value",
+				(StrictMath.abs(1908.8976f) == 1908.8976f));
+	}
 
-        assertTrue("Incorrect double abs value",
-                (StrictMath.abs(-1908.8976) == 1908.8976));
-        assertTrue("Incorrect double abs value",
-                (StrictMath.abs(1908.8976) == 1908.8976));
-        
-        assertEquals(0.0, StrictMath.abs(0.0));
-        assertEquals(0.0, StrictMath.abs(-0.0));
-        assertEquals(Double.POSITIVE_INFINITY, StrictMath.abs(Double.POSITIVE_INFINITY));    
-        assertEquals(Double.POSITIVE_INFINITY, StrictMath.abs(Double.NEGATIVE_INFINITY));      
-        assertEquals(Double.NaN, StrictMath.abs(Double.NaN));      
-    }
+	/**
+	 * @tests java.lang.StrictMath#abs(int)
+	 */
+	public void test_absI() {
+		// Test for method int java.lang.StrictMath.abs(int)
+		assertTrue("Incorrect int abs value",
+				(StrictMath.abs(-1908897) == 1908897));
+		assertTrue("Incorrect int abs value",
+				(StrictMath.abs(1908897) == 1908897));
+	}
 
-    /**
-     * @tests java.lang.StrictMath#abs(float)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "abs",
-        args = {float.class}
-    )
-    public void test_absF() {
-        // Test for method float java.lang.StrictMath.abs(float)
-        assertTrue("Incorrect float abs value",
-                (StrictMath.abs(-1908.8976f) == 1908.8976f));
-        assertTrue("Incorrect float abs value",
-                (StrictMath.abs(1908.8976f) == 1908.8976f));
-        
-        assertEquals(0f, StrictMath.abs(0f));
-        assertEquals(0f, StrictMath.abs(-0f));
-        assertEquals(Float.POSITIVE_INFINITY, StrictMath.abs(Float.POSITIVE_INFINITY));    
-        assertEquals(Float.POSITIVE_INFINITY, StrictMath.abs(Float.NEGATIVE_INFINITY));      
-        assertEquals(Float.NaN, StrictMath.abs(Float.NaN));        
-    }
+	/**
+	 * @tests java.lang.StrictMath#abs(long)
+	 */
+	public void test_absJ() {
+		// Test for method long java.lang.StrictMath.abs(long)
+		assertTrue("Incorrect long abs value", (StrictMath
+				.abs(-19088976000089L) == 19088976000089L));
+		assertTrue("Incorrect long abs value",
+				(StrictMath.abs(19088976000089L) == 19088976000089L));
+	}
 
-    /**
-     * @tests java.lang.StrictMath#abs(int)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "abs",
-        args = {int.class}
-    )
-    public void test_absI() {
-        // Test for method int java.lang.StrictMath.abs(int)
-        assertTrue("Incorrect int abs value",
-                (StrictMath.abs(-1908897) == 1908897));
-        assertTrue("Incorrect int abs value",
-                (StrictMath.abs(1908897) == 1908897));
-        
-        assertEquals(Integer.MIN_VALUE, StrictMath.abs(Integer.MIN_VALUE));
-    }
+	/**
+	 * @tests java.lang.StrictMath#acos(double)
+	 */
+	public void test_acosD() {
+		// Test for method double java.lang.StrictMath.acos(double)
+		assertTrue("Returned incorrect arc cosine", StrictMath.cos(StrictMath
+				.acos(ADJ / HYP)) == ADJ / HYP);
+	}
 
-    /**
-     * @tests java.lang.StrictMath#abs(long)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "abs",
-        args = {long.class}
-    )
-    public void test_absJ() {
-        // Test for method long java.lang.StrictMath.abs(long)
-        assertTrue("Incorrect long abs value", (StrictMath
-                .abs(-19088976000089L) == 19088976000089L));
-        assertTrue("Incorrect long abs value",
-                (StrictMath.abs(19088976000089L) == 19088976000089L));
-        
-        assertEquals(Long.MIN_VALUE, StrictMath.abs(Long.MIN_VALUE));        
-    }
+	/**
+	 * @tests java.lang.StrictMath#asin(double)
+	 */
+	public void test_asinD() {
+		// Test for method double java.lang.StrictMath.asin(double)
+		assertTrue("Returned incorrect arc sine", StrictMath.sin(StrictMath
+				.asin(OPP / HYP)) == OPP / HYP);
+	}
 
-    /**
-     * @tests java.lang.StrictMath#acos(double)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "acos",
-        args = {double.class}
-    )
-    public void test_acosD() {
-        // Test for method double java.lang.StrictMath.acos(double)
-        assertTrue("Returned incorrect arc cosine", StrictMath.cos(StrictMath
-                .acos(ADJ / HYP)) == ADJ / HYP);
-        
-        assertEquals(Double.NaN, StrictMath.acos(Double.NaN));
-        assertEquals(Double.NaN, StrictMath.acos(1.1));        
-    }
+	/**
+	 * @tests java.lang.StrictMath#atan(double)
+	 */
+	public void test_atanD() {
+		// Test for method double java.lang.StrictMath.atan(double)
+		double answer = StrictMath.tan(StrictMath.atan(1.0));
+		assertTrue("Returned incorrect arc tangent: " + answer, answer <= 1.0
+				&& answer >= 9.9999999999999983E-1);
+	}
 
-    /**
-     * @tests java.lang.StrictMath#asin(double)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "asin",
-        args = {double.class}
-    )
-    public void test_asinD() {
-        // Test for method double java.lang.StrictMath.asin(double)
-        assertTrue("Returned incorrect arc sine", StrictMath.sin(StrictMath
-                .asin(OPP / HYP)) == OPP / HYP);
-        
-        assertEquals(Double.NaN, StrictMath.asin(Double.NaN));
-        assertEquals(Double.NaN, StrictMath.asin(1.1));        
-        assertEquals(0.0, StrictMath.asin(0.0));  
-        assertEquals(-0.0, StrictMath.asin(-0.0));          
-    }
-
-    /**
-     * @tests java.lang.StrictMath#atan(double)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Doesn't check boundary values.",
-        method = "atan",
-        args = {double.class}
-    )
-    public void test_atanD() {
-        // Test for method double java.lang.StrictMath.atan(double)
-        double answer = StrictMath.tan(StrictMath.atan(1.0));
-        assertTrue("Returned incorrect arc tangent: " + answer, answer <= 1.0
-                && answer >= 9.9999999999999983E-1);
-    }
-
-    /**
-     * @tests java.lang.StrictMath#atan2(double, double)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "atan2",
-        args = {double.class, double.class}
-    )
-    public void test_atan2DD() {
-        // Test for method double java.lang.StrictMath.atan2(double, double)
-        double answer = StrictMath.atan(StrictMath.tan(1.0));
-        assertTrue("Returned incorrect arc tangent: " + answer, answer <= 1.0
-                && answer >= 9.9999999999999983E-1);
-        
-        assertEquals(Double.NaN, StrictMath.atan2(Double.NaN, 1.0));
-        assertEquals(Double.NaN, StrictMath.atan2(Double.NaN, 1.0));
-        
-        assertEquals(0.0, StrictMath.atan2(0.0, 1.0));
-        assertEquals(0.0, StrictMath.atan2(1.0, Double.POSITIVE_INFINITY));   
-        
-        assertEquals(-0.0, StrictMath.atan2(-0.0, 1.0));      
-        assertEquals(-0.0, StrictMath.atan2(-1.0, Double.POSITIVE_INFINITY)); 
-        
-        assertEquals(StrictMath.PI, StrictMath.atan2(0.0, -1.0));      
-        assertEquals(StrictMath.PI, StrictMath.atan2(1.0, 
-                                                     Double.NEGATIVE_INFINITY));     
-        
-        assertEquals(-StrictMath.PI, StrictMath.atan2(-0.0, -1.0));   
-        assertEquals(-StrictMath.PI, StrictMath.atan2(-1.0, 
-                                                     Double.NEGATIVE_INFINITY));     
-        
-        assertEquals(StrictMath.PI/2, StrictMath.atan2(1.0, 0.0));   
-        assertEquals(StrictMath.PI/2, StrictMath.atan2(1.0, -0.0));        
-        assertEquals(StrictMath.PI/2, StrictMath.atan2(Double.POSITIVE_INFINITY, 0.0)); 
-        
-        assertEquals(-StrictMath.PI/2, StrictMath.atan2(-1.0, 0.0));   
-        assertEquals(-StrictMath.PI/2, StrictMath.atan2(-1.0, -0.0));        
-        assertEquals(-StrictMath.PI/2, StrictMath.atan2(Double.NEGATIVE_INFINITY, 1.0));  
-        
-        assertEquals(StrictMath.PI/4, StrictMath.atan2(Double.POSITIVE_INFINITY, 
-                                                     Double.POSITIVE_INFINITY)); 
-        assertEquals(3*StrictMath.PI/4, 
-                                      StrictMath.atan2(Double.POSITIVE_INFINITY, 
-                                                     Double.NEGATIVE_INFINITY));     
-        
-        assertEquals(-StrictMath.PI/4, 
-                StrictMath.atan2(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY));  
-        
-        assertEquals(-3*StrictMath.PI/4, 
-                                      StrictMath.atan2(Double.NEGATIVE_INFINITY, 
-                                                     Double.NEGATIVE_INFINITY));        
-    }
+	/**
+	 * @tests java.lang.StrictMath#atan2(double, double)
+	 */
+	public void test_atan2DD() {
+		// Test for method double java.lang.StrictMath.atan2(double, double)
+		double answer = StrictMath.atan(StrictMath.tan(1.0));
+		assertTrue("Returned incorrect arc tangent: " + answer, answer <= 1.0
+				&& answer >= 9.9999999999999983E-1);
+	}
     
     /**
      * @tests java.lang.StrictMath#cbrt(double)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "cbrt",
-        args = {double.class}
-    )
     @SuppressWarnings("boxing")
     public void test_cbrt_D() {
         // Test for special situations
@@ -392,11 +136,11 @@
                 Double.NEGATIVE_INFINITY, StrictMath
                         .cbrt(Double.NEGATIVE_INFINITY));
         assertEquals(Double.doubleToLongBits(0.0), Double
-                .doubleToLongBits(StrictMath.cbrt(0.0)));
-        assertEquals(Double.doubleToLongBits(+0.0), Double
-                .doubleToLongBits(StrictMath.cbrt(+0.0)));
-        assertEquals(Double.doubleToLongBits(-0.0), Double
-                .doubleToLongBits(StrictMath.cbrt(-0.0)));
+				.doubleToLongBits(StrictMath.cbrt(0.0)));
+		assertEquals(Double.doubleToLongBits(+0.0), Double
+				.doubleToLongBits(StrictMath.cbrt(+0.0)));
+		assertEquals(Double.doubleToLongBits(-0.0), Double
+				.doubleToLongBits(StrictMath.cbrt(-0.0)));
 
         assertEquals("Should return 3.0", 3.0, StrictMath.cbrt(27.0));
         assertEquals("Should return 23.111993172558684", 23.111993172558684,
@@ -420,67 +164,159 @@
         }
     }
 
-    /**
-     * @tests java.lang.StrictMath#ceil(double)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "ceil",
-        args = {double.class}
-    )
-    public void test_ceilD() {
-        // Test for method double java.lang.StrictMath.ceil(double)
+	/**
+	 * @tests java.lang.StrictMath#ceil(double)
+	 */
+	public void test_ceilD() {
+		// Test for method double java.lang.StrictMath.ceil(double)
                 assertEquals("Incorrect ceiling for double",
                              79, StrictMath.ceil(78.89), 0.0);
-        assertEquals("Incorrect ceiling for double",
+		assertEquals("Incorrect ceiling for double",
                              -78, StrictMath.ceil(-78.89), 0.0);
+	}
+	
+	/**
+     * @tests {@link java.lang.StrictMath#copySign(double, double)}
+     * @since 1.6
+     */
+    @SuppressWarnings("boxing")
+    public void test_copySign_DD() {
+        for (int i = 0; i < COPYSIGN_DD_CASES.length; i++) {
+            final double magnitude = COPYSIGN_DD_CASES[i];
+            final long absMagnitudeBits = Double.doubleToLongBits(StrictMath
+                    .abs(magnitude));
+            final long negMagnitudeBits = Double.doubleToLongBits(-StrictMath
+                    .abs(magnitude));
+
+            // cases for NaN
+            assertEquals("If the sign is NaN, the result should be positive.",
+                    absMagnitudeBits, Double.doubleToLongBits(StrictMath
+                            .copySign(magnitude, Double.NaN)));
+            assertTrue("The result should be NaN.", Double.isNaN(StrictMath
+                    .copySign(Double.NaN, magnitude)));
+
+            for (int j = 0; j < COPYSIGN_DD_CASES.length; j++) {
+                final double sign = COPYSIGN_DD_CASES[j];
+                final long resultBits = Double.doubleToLongBits(StrictMath
+                        .copySign(magnitude, sign));
+
+                if (sign > 0 || Double.valueOf(+0.0).equals(sign)
+                        || Double.valueOf(0.0).equals(sign)) {
+                    assertEquals(
+                            "If the sign is positive, the result should be positive.",
+                            absMagnitudeBits, resultBits);
+                }
+                if (sign < 0 || Double.valueOf(-0.0).equals(sign)) {
+                    assertEquals(
+                            "If the sign is negative, the result should be negative.",
+                            negMagnitudeBits, resultBits);
+                }
+            }
+        }
+
+        assertTrue("The result should be NaN.", Double.isNaN(StrictMath
+                .copySign(Double.NaN, Double.NaN)));
+
+        try {
+            StrictMath.copySign((Double) null, 2.3);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
+        try {
+            StrictMath.copySign(2.3, (Double) null);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
+        try {
+            StrictMath.copySign((Double) null, (Double) null);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
         
-        assertEquals("Incorrect ceiling for mathematical integer",
-                             -78, StrictMath.ceil(-78), 0.0);  
-        assertEquals("Incorrect ceiling for NaN",
-                                       Double.NaN, StrictMath.ceil(Double.NaN));
-        assertEquals("Incorrect ceiling for positive infinity", 
-                Double.POSITIVE_INFINITY, 
-                StrictMath.ceil(Double.POSITIVE_INFINITY));        
-        assertEquals("Incorrect ceiling for negative infinity", 
-                Double.NEGATIVE_INFINITY, 
-                StrictMath.ceil(Double.NEGATIVE_INFINITY));  
-        assertEquals("Incorrect ceiling for positive zero.", 
-                0.0, StrictMath.ceil(0.0));
-        assertEquals("Incorrect ceiling for negative zero.", 
-                -0.0, StrictMath.ceil(-0.0)); 
-        assertEquals("Incorrect ceiling for negative zero.", 
-                -0.0, StrictMath.ceil(-0.5));         
+		double d = Double.longBitsToDouble(0xfff8000000000000L);
+		assertEquals(1.0, StrictMath.copySign(1.0, d), 0d);
     }
 
     /**
-     * @tests java.lang.StrictMath#cos(double)
+     * @tests {@link java.lang.StrictMath#copySign(float, float)}
+     * @since 1.6
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "cos",
-        args = {double.class}
-    )
-    public void test_cosD() {
-        // Test for method double java.lang.StrictMath.cos(double)
+    @SuppressWarnings("boxing")
+    public void test_copySign_FF() {
+        for (int i = 0; i < COPYSIGN_FF_CASES.length; i++) {
+            final float magnitude = COPYSIGN_FF_CASES[i];
+            final int absMagnitudeBits = Float.floatToIntBits(StrictMath
+                    .abs(magnitude));
+            final int negMagnitudeBits = Float.floatToIntBits(-StrictMath
+                    .abs(magnitude));
 
-        assertTrue("Returned incorrect cosine", StrictMath.cos(StrictMath
-                .acos(ADJ / HYP)) == ADJ / HYP);
-        assertEquals("Returned incorrect cosine", StrictMath.cos(Double.NaN), 
-                                                                 Double.NaN);        
+            // cases for NaN
+            assertEquals("If the sign is NaN, the result should be positive.",
+                    absMagnitudeBits, Float.floatToIntBits(StrictMath.copySign(
+                            magnitude, Float.NaN)));
+            assertTrue("The result should be NaN.", Float.isNaN(StrictMath
+                    .copySign(Float.NaN, magnitude)));
+
+            for (int j = 0; j < COPYSIGN_FF_CASES.length; j++) {
+                final float sign = COPYSIGN_FF_CASES[j];
+                final int resultBits = Float.floatToIntBits(StrictMath
+                        .copySign(magnitude, sign));
+                if (sign > 0 || Float.valueOf(+0.0f).equals(sign)
+                        || Float.valueOf(0.0f).equals(sign)) {
+                    assertEquals(
+                            "If the sign is positive, the result should be positive.",
+                            absMagnitudeBits, resultBits);
+                }
+                if (sign < 0 || Float.valueOf(-0.0f).equals(sign)) {
+                    assertEquals(
+                            "If the sign is negative, the result should be negative.",
+                            negMagnitudeBits, resultBits);
+                }
+            }
+        }
+
+        assertTrue("The result should be NaN.", Float.isNaN(StrictMath
+                .copySign(Float.NaN, Float.NaN)));
+
+        try {
+            StrictMath.copySign((Float) null, 2.3f);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
+        try {
+            StrictMath.copySign(2.3f, (Float) null);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
+        try {
+            StrictMath.copySign((Float) null, (Float) null);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
+        
+		float f = Float.intBitsToFloat(0xffc00000);
+		assertEquals(1.0f, StrictMath.copySign(1.0f, f), 0f);
     }
+
+	/**
+	 * @tests java.lang.StrictMath#cos(double)
+	 */
+	public void test_cosD() {
+		// Test for method double java.lang.StrictMath.cos(double)
+
+		assertTrue("Returned incorrect cosine", StrictMath.cos(StrictMath
+				.acos(ADJ / HYP)) == ADJ / HYP);
+	}
     
     /**
      * @tests java.lang.StrictMath#cosh(double)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "cosh",
-        args = {double.class}
-    )
     @SuppressWarnings("boxing")
     public void test_cosh_D() {
         // Test for special situations        
@@ -512,39 +348,21 @@
                 .cosh(Double.MIN_VALUE));
     }
 
-    /**
-     * @tests java.lang.StrictMath#exp(double)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "exp",
-        args = {double.class}
-    )
-    public void test_expD() {
-        // Test for method double java.lang.StrictMath.exp(double)
-        assertTrue("Incorrect answer returned for simple power", StrictMath
-                .abs(StrictMath.exp(4D) - StrictMath.E * StrictMath.E
-                        * StrictMath.E * StrictMath.E) < 0.1D);
-        assertTrue("Incorrect answer returned for larger power", StrictMath
-                .log(StrictMath.abs(StrictMath.exp(5.5D)) - 5.5D) < 10.0D);
-        assertEquals("Returned incorrect value for NaN argument", Double.NaN, 
-                                                    StrictMath.exp(Double.NaN));
-        assertEquals("Returned incorrect value for positive infinity.", 
-            Double.POSITIVE_INFINITY, StrictMath.exp(Double.POSITIVE_INFINITY));    
-        assertEquals("Returned incorrect value for negative infinity.", 
-                                 0.0, StrictMath.exp(Double.NEGATIVE_INFINITY));  
-    }
+	/**
+	 * @tests java.lang.StrictMath#exp(double)
+	 */
+	public void test_expD() {
+		// Test for method double java.lang.StrictMath.exp(double)
+		assertTrue("Incorrect answer returned for simple power", StrictMath
+				.abs(StrictMath.exp(4D) - StrictMath.E * StrictMath.E
+						* StrictMath.E * StrictMath.E) < 0.1D);
+		assertTrue("Incorrect answer returned for larger power", StrictMath
+				.log(StrictMath.abs(StrictMath.exp(5.5D)) - 5.5D) < 10.0D);
+	}
     
     /**
      * @tests java.lang.StrictMath#expm1(double)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "expm1",
-        args = {double.class}
-    )
     @SuppressWarnings("boxing")
     public void test_expm1_D() {
         //Test for special cases        
@@ -554,11 +372,11 @@
         assertEquals("Should return -1.0", -1.0, StrictMath
                 .expm1(Double.NEGATIVE_INFINITY));
         assertEquals(Double.doubleToLongBits(0.0), Double
-                .doubleToLongBits(StrictMath.expm1(0.0)));
-        assertEquals(Double.doubleToLongBits(+0.0), Double
-                .doubleToLongBits(StrictMath.expm1(+0.0)));
-        assertEquals(Double.doubleToLongBits(-0.0), Double
-                .doubleToLongBits(StrictMath.expm1(-0.0)));
+				.doubleToLongBits(StrictMath.expm1(0.0)));
+		assertEquals(Double.doubleToLongBits(+0.0), Double
+				.doubleToLongBits(StrictMath.expm1(+0.0)));
+		assertEquals(Double.doubleToLongBits(-0.0), Double
+				.doubleToLongBits(StrictMath.expm1(-0.0)));
 
         assertEquals("Should return -9.999950000166666E-6",
                 -9.999950000166666E-6, StrictMath.expm1(-0.00001));
@@ -574,44 +392,61 @@
        
     }    
 
-    /**
-     * @tests java.lang.StrictMath#floor(double)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "floor",
-        args = {double.class}
-    )
-    public void test_floorD() {
-        // Test for method double java.lang.StrictMath.floor(double)
+	/**
+	 * @tests java.lang.StrictMath#floor(double)
+	 */
+	public void test_floorD() {
+		// Test for method double java.lang.StrictMath.floor(double)
                 assertEquals("Incorrect floor for double",
                              78, StrictMath.floor(78.89), 0.0);
-        assertEquals("Incorrect floor for double",
+		assertEquals("Incorrect floor for double",
                              -79, StrictMath.floor(-78.89), 0.0);
-        assertEquals("Incorrect floor for mathematical integer",
-                             -79, StrictMath.floor(-79), 0.0);
-        assertEquals("Incorrect floor for NaN",
-                        Double.NaN, StrictMath.floor(Double.NaN));    
-        assertEquals("Incorrect floor for positive infinity.",
-          Double.POSITIVE_INFINITY, StrictMath.floor(Double.POSITIVE_INFINITY));    
-        assertEquals("Incorrect floor for negative infinity.",
-          Double.NEGATIVE_INFINITY, StrictMath.floor(Double.NEGATIVE_INFINITY));  
-        assertEquals("Incorrect floor for positive zero.",
-                                                    0.0, StrictMath.floor(0.0)); 
-        assertEquals("Incorrect floor for negative zero.",
-                                                  -0.0, StrictMath.floor(-0.0));        
+	}
+	
+	/**
+     * @tests {@link java.lang.StrictMath#getExponent(double)}
+     * @since 1.6
+     */
+    @SuppressWarnings("boxing")
+    public void test_getExponent_D() {
+        for (int i = 0; i < GETEXPONENT_D_CASES.length; i++) {
+            final double number = GETEXPONENT_D_CASES[i];
+            final int result = GETEXPONENT_D_RESULTS[i];
+            assertEquals("Wrong result of getExponent(double).", result,
+                    StrictMath.getExponent(number));
+        }
+
+        try {
+            StrictMath.getExponent((Double) null);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
+    }
+
+    /**
+     * @tests {@link java.lang.StrictMath#getExponent(float)}
+     * @since 1.6
+     */
+    @SuppressWarnings("boxing")
+    public void test_getExponent_F() {
+        for (int i = 0; i < GETEXPONENT_F_CASES.length; i++) {
+            final float number = GETEXPONENT_F_CASES[i];
+            final int result = GETEXPONENT_F_RESULTS[i];
+            assertEquals("Wrong result of getExponent(float).", result,
+                    StrictMath.getExponent(number));
+        }
+        try {
+            StrictMath.getExponent((Float) null);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
     }
     
     /**
      * @tests java.lang.StrictMath#hypot(double, double)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hypot",
-        args = {double.class, double.class}
-    )
     @SuppressWarnings("boxing")
     public void test_hypot_DD() {
         // Test for special cases
@@ -649,77 +484,37 @@
 
     }
 
-    /**
-     * @tests java.lang.StrictMath#IEEEremainder(double, double)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "IEEEremainder",
-        args = {double.class, double.class}
-    )
-    public void test_IEEEremainderDD() {
-        // Test for method double java.lang.StrictMath.IEEEremainder(double,
-        // double)
-        assertEquals("Incorrect remainder returned", 0.0, StrictMath.IEEEremainder(
-                1.0, 1.0), 0.0);
-        assertTrue(
-                "Incorrect remainder returned",
-                StrictMath.IEEEremainder(1.32, 89.765) >= 1.4705063220631647E-2
-                        || StrictMath.IEEEremainder(1.32, 89.765) >= 1.4705063220631649E-2);
-        
-        assertEquals(Double.NaN, StrictMath.IEEEremainder(Double.NaN, 0.0));
-        assertEquals(Double.NaN, StrictMath.IEEEremainder(0.0, Double.NaN));
-        assertEquals(Double.NaN, StrictMath.IEEEremainder(Double.POSITIVE_INFINITY, 0.0));
-        assertEquals(Double.NaN, StrictMath.IEEEremainder(Double.NEGATIVE_INFINITY, 0.0));
-        assertEquals(Double.NaN, StrictMath.IEEEremainder(0.0, 0.0));
-        assertEquals(Double.NaN, StrictMath.IEEEremainder(-0.0, 0.0));
-        
-        assertEquals(1.0, StrictMath.IEEEremainder(1.0, Double.POSITIVE_INFINITY));
-        assertEquals(1.0, StrictMath.IEEEremainder(1.0, Double.NEGATIVE_INFINITY));        
-        
-    }
+	/**
+	 * @tests java.lang.StrictMath#IEEEremainder(double, double)
+	 */
+	public void test_IEEEremainderDD() {
+		// Test for method double java.lang.StrictMath.IEEEremainder(double,
+		// double)
+		assertEquals("Incorrect remainder returned", 0.0, StrictMath.IEEEremainder(
+				1.0, 1.0), 0.0);
+		assertTrue(
+				"Incorrect remainder returned",
+				StrictMath.IEEEremainder(1.32, 89.765) >= 1.4705063220631647E-2
+						|| StrictMath.IEEEremainder(1.32, 89.765) >= 1.4705063220631649E-2);
+	}
 
-    /**
-     * @tests java.lang.StrictMath#log(double)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "log",
-        args = {double.class}
-    )
-    public void test_logD() {
-        // Test for method double java.lang.StrictMath.log(double)
-        for (double d = 10; d >= -10; d -= 0.5) {
-            double answer = StrictMath.log(StrictMath.exp(d));
-            assertTrue("Answer does not equal expected answer for d = " + d
-                    + " answer = " + answer,
-                    StrictMath.abs(answer - d) <= StrictMath
-                            .abs(d * 0.00000001));
-        }
-        
-        assertEquals("Returned incorrect value for NaN.", 
-                                        Double.NaN, StrictMath.log(Double.NaN));
-        assertEquals("Returned incorrect value for positive infinity.", 
-            Double.POSITIVE_INFINITY, StrictMath.log(Double.POSITIVE_INFINITY));     
-        assertEquals("Returned incorrect value for negative infinity.", 
-                          Double.NaN, StrictMath.log(Double.NEGATIVE_INFINITY));  
-        assertEquals("Returned incorrect value for positive zero.", 
-                                 Double.NEGATIVE_INFINITY, StrictMath.log(0.0));  
-        assertEquals("Returned incorrect value for negative zero.", 
-                                Double.NEGATIVE_INFINITY, StrictMath.log(-0.0));        
-    }
+	/**
+	 * @tests java.lang.StrictMath#log(double)
+	 */
+	public void test_logD() {
+		// Test for method double java.lang.StrictMath.log(double)
+		for (double d = 10; d >= -10; d -= 0.5) {
+			double answer = StrictMath.log(StrictMath.exp(d));
+			assertTrue("Answer does not equal expected answer for d = " + d
+					+ " answer = " + answer,
+					StrictMath.abs(answer - d) <= StrictMath
+							.abs(d * 0.00000001));
+		}
+	}
     
     /**
      * @tests java.lang.StrictMath#log10(double)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "log10",
-        args = {double.class}
-    )
     @SuppressWarnings("boxing")
     public void test_log10_D() {
         // Test for special cases        
@@ -754,12 +549,6 @@
     /**
      * @tests java.lang.StrictMath#log1p(double)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "log1p",
-        args = {double.class}
-    )
     @SuppressWarnings("boxing")
     public void test_log1p_D() {
         // Test for special cases
@@ -771,11 +560,11 @@
                 Double.POSITIVE_INFINITY, StrictMath
                         .log1p(Double.POSITIVE_INFINITY));
         assertEquals(Double.doubleToLongBits(0.0), Double
-                .doubleToLongBits(StrictMath.log1p(0.0)));
-        assertEquals(Double.doubleToLongBits(+0.0), Double
-                .doubleToLongBits(StrictMath.log1p(+0.0)));
-        assertEquals(Double.doubleToLongBits(-0.0), Double
-                .doubleToLongBits(StrictMath.log1p(-0.0)));
+				.doubleToLongBits(StrictMath.log1p(0.0)));
+		assertEquals(Double.doubleToLongBits(+0.0), Double
+				.doubleToLongBits(StrictMath.log1p(+0.0)));
+		assertEquals(Double.doubleToLongBits(-0.0), Double
+				.doubleToLongBits(StrictMath.log1p(-0.0)));
 
         assertEquals("Should return -0.2941782295312541", -0.2941782295312541,
                 StrictMath.log1p(-0.254856327));
@@ -792,330 +581,659 @@
     /**
      * @tests java.lang.StrictMath#max(double, double)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "max",
-        args = {double.class, double.class}
-    )
-    public void test_maxDD() {
-        // Test for method double java.lang.StrictMath.max(double, double)
-        assertEquals("Incorrect double max value", 1908897.6000089, StrictMath.max(
-                -1908897.6000089, 1908897.6000089), 0D);
-        assertEquals("Incorrect double max value", 1908897.6000089, StrictMath.max(2.0,
-                1908897.6000089), 0D);
-        assertEquals("Incorrect double max value", -2.0, StrictMath.max(-2.0,
-                -1908897.6000089), 0D);
+	public void test_maxDD() {
+		// Test for method double java.lang.StrictMath.max(double, double)
+		assertEquals("Incorrect double max value", 1908897.6000089, StrictMath.max(
+				-1908897.6000089, 1908897.6000089), 0D);
+		assertEquals("Incorrect double max value", 1908897.6000089, StrictMath.max(2.0,
+				1908897.6000089), 0D);
+		assertEquals("Incorrect double max value", -2.0, StrictMath.max(-2.0,
+				-1908897.6000089), 0D);
 
-        assertEquals("Incorrect double max value", Double.NaN, 
-                                               StrictMath.max(Double.NaN, 1.0));
-        assertEquals("Incorrect double max value", 0.0, 
-                                                     StrictMath.max(0.0, -0.0));        
+	}
+
+	/**
+	 * @tests java.lang.StrictMath#max(float, float)
+	 */
+	public void test_maxFF() {
+		// Test for method float java.lang.StrictMath.max(float, float)
+		assertTrue("Incorrect float max value", StrictMath.max(-1908897.600f,
+				1908897.600f) == 1908897.600f);
+		assertTrue("Incorrect float max value", StrictMath.max(2.0f,
+				1908897.600f) == 1908897.600f);
+		assertTrue("Incorrect float max value", StrictMath.max(-2.0f,
+				-1908897.600f) == -2.0f);
+	}
+
+	/**
+	 * @tests java.lang.StrictMath#max(int, int)
+	 */
+	public void test_maxII() {
+		// Test for method int java.lang.StrictMath.max(int, int)
+		assertEquals("Incorrect int max value", 19088976, StrictMath.max(-19088976,
+				19088976));
+		assertEquals("Incorrect int max value",
+				19088976, StrictMath.max(20, 19088976));
+		assertEquals("Incorrect int max value",
+				-20, StrictMath.max(-20, -19088976));
+	}
+
+	/**
+	 * @tests java.lang.StrictMath#max(long, long)
+	 */
+	public void test_maxJJ() {
+		// Test for method long java.lang.StrictMath.max(long, long)
+		assertEquals("Incorrect long max value", 19088976000089L, StrictMath.max(-19088976000089L,
+				19088976000089L));
+		assertEquals("Incorrect long max value", 19088976000089L, StrictMath.max(20,
+				19088976000089L));
+		assertEquals("Incorrect long max value", -20, StrictMath.max(-20,
+				-19088976000089L));
+	}
+
+	/**
+	 * @tests java.lang.StrictMath#min(double, double)
+	 */
+	public void test_minDD() {
+		// Test for method double java.lang.StrictMath.min(double, double)
+		assertEquals("Incorrect double min value", -1908897.6000089, StrictMath.min(
+				-1908897.6000089, 1908897.6000089), 0D);
+		assertEquals("Incorrect double min value", 2.0, StrictMath.min(2.0,
+				1908897.6000089), 0D);
+		assertEquals("Incorrect double min value", -1908897.6000089, StrictMath.min(-2.0,
+				-1908897.6000089), 0D);
+	}
+
+	/**
+	 * @tests java.lang.StrictMath#min(float, float)
+	 */
+	public void test_minFF() {
+		// Test for method float java.lang.StrictMath.min(float, float)
+		assertTrue("Incorrect float min value", StrictMath.min(-1908897.600f,
+				1908897.600f) == -1908897.600f);
+		assertTrue("Incorrect float min value", StrictMath.min(2.0f,
+				1908897.600f) == 2.0f);
+		assertTrue("Incorrect float min value", StrictMath.min(-2.0f,
+				-1908897.600f) == -1908897.600f);
+	}
+
+	/**
+	 * @tests java.lang.StrictMath#min(int, int)
+	 */
+	public void test_minII() {
+		// Test for method int java.lang.StrictMath.min(int, int)
+		assertEquals("Incorrect int min value", -19088976, StrictMath.min(-19088976,
+				19088976));
+		assertEquals("Incorrect int min value",
+				20, StrictMath.min(20, 19088976));
+		assertEquals("Incorrect int min value",
+				-19088976, StrictMath.min(-20, -19088976));
+
+	}
+
+	/**
+	 * @tests java.lang.StrictMath#min(long, long)
+	 */
+	public void test_minJJ() {
+		// Test for method long java.lang.StrictMath.min(long, long)
+		assertEquals("Incorrect long min value", -19088976000089L, StrictMath.min(-19088976000089L,
+				19088976000089L));
+		assertEquals("Incorrect long min value", 20, StrictMath.min(20,
+				19088976000089L));
+		assertEquals("Incorrect long min value", -19088976000089L, StrictMath.min(-20,
+				-19088976000089L));
+	}
+	
+	 /**
+     * @tests {@link java.lang.StrictMath#nextAfter(double, double)}
+     * @since 1.6
+     */
+    @SuppressWarnings("boxing")
+    public void test_nextAfter_DD() {
+        // test for most cases without exception
+        for (int i = 0; i < NEXTAFTER_DD_START_CASES.length; i++) {
+            final double start = NEXTAFTER_DD_START_CASES[i][0];
+            final long nextUpBits = Double
+                    .doubleToLongBits(NEXTAFTER_DD_START_CASES[i][1]);
+            final long nextDownBits = Double
+                    .doubleToLongBits(NEXTAFTER_DD_START_CASES[i][2]);
+
+            for (int j = 0; j < NEXTAFTER_DD_FD_DIRECTION_CASES.length; j++) {
+                final double direction = NEXTAFTER_DD_FD_DIRECTION_CASES[j];
+                final long resultBits = Double.doubleToLongBits(StrictMath
+                        .nextAfter(start, direction));
+                final long directionBits = Double.doubleToLongBits(direction);
+                if (direction > start) {
+                    assertEquals("Result should be next up-number.",
+                            nextUpBits, resultBits);
+                } else if (direction < start) {
+                    assertEquals("Result should be next down-number.",
+                            nextDownBits, resultBits);
+                } else {
+                    assertEquals("Result should be direction.", directionBits,
+                            resultBits);
+                }
+            }
+        }
+
+        // test for cases with NaN
+        for (int i = 0; i < NEXTAFTER_DD_START_CASES.length; i++) {
+            assertTrue("The result should be NaN.", Double.isNaN(StrictMath
+                    .nextAfter(NEXTAFTER_DD_START_CASES[i][0], Double.NaN)));
+        }
+        for (int i = 0; i < NEXTAFTER_DD_FD_DIRECTION_CASES.length; i++) {
+            assertTrue("The result should be NaN.", Double.isNaN(StrictMath
+                    .nextAfter(Double.NaN, NEXTAFTER_DD_FD_DIRECTION_CASES[i])));
+        }
+        assertTrue("The result should be NaN.", Double.isNaN(StrictMath
+                .nextAfter(Double.NaN, Double.NaN)));
+
+        // test for exception
+        try {
+            StrictMath.nextAfter((Double) null, 2.3);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
+        try {
+            StrictMath.nextAfter(2.3, (Double) null);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
+        try {
+            StrictMath.nextAfter((Double) null, (Double) null);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
     }
 
     /**
-     * @tests java.lang.StrictMath#max(float, float)
+     * @tests {@link java.lang.StrictMath#nextAfter(float, double)}
+     * @since 1.6
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "max",
-        args = {float.class, float.class}
-    )
-    public void test_maxFF() {
-        // Test for method float java.lang.StrictMath.max(float, float)
-        assertTrue("Incorrect float max value", StrictMath.max(-1908897.600f,
-                1908897.600f) == 1908897.600f);
-        assertTrue("Incorrect float max value", StrictMath.max(2.0f,
-                1908897.600f) == 1908897.600f);
-        assertTrue("Incorrect float max value", StrictMath.max(-2.0f,
-                -1908897.600f) == -2.0f);
-        assertEquals("Incorrect float max value", Float.NaN, 
-                                                 StrictMath.max(Float.NaN, 1f));
-        assertEquals("Incorrect float max value", 0f, 
-                                                       StrictMath.max(0f, -0f));           
+    @SuppressWarnings("boxing")
+    public void test_nextAfter_FD() {
+        // test for most cases without exception
+        for (int i = 0; i < NEXTAFTER_FD_START_CASES.length; i++) {
+            final float start = NEXTAFTER_FD_START_CASES[i][0];
+            final int nextUpBits = Float
+                    .floatToIntBits(NEXTAFTER_FD_START_CASES[i][1]);
+            final int nextDownBits = Float
+                    .floatToIntBits(NEXTAFTER_FD_START_CASES[i][2]);
+
+            for (int j = 0; j < NEXTAFTER_DD_FD_DIRECTION_CASES.length; j++) {
+                final double direction = NEXTAFTER_DD_FD_DIRECTION_CASES[j];
+                final int resultBits = Float.floatToIntBits(StrictMath
+                        .nextAfter(start, direction));
+                if (direction > start) {
+                    assertEquals("Result should be next up-number.",
+                            nextUpBits, resultBits);
+                } else if (direction < start) {
+                    assertEquals("Result should be next down-number.",
+                            nextDownBits, resultBits);
+                } else {
+                    final int equivalentBits = Float.floatToIntBits(new Float(
+                            direction));
+                    assertEquals(
+                            "Result should be a number equivalent to direction.",
+                            equivalentBits, resultBits);
+                }
+            }
+        }
+
+        // test for cases with NaN
+        for (int i = 0; i < NEXTAFTER_FD_START_CASES.length; i++) {
+            assertTrue("The result should be NaN.", Float.isNaN(StrictMath
+                    .nextAfter(NEXTAFTER_FD_START_CASES[i][0], Float.NaN)));
+        }
+        for (int i = 0; i < NEXTAFTER_DD_FD_DIRECTION_CASES.length; i++) {
+            assertTrue("The result should be NaN.", Float.isNaN(StrictMath
+                    .nextAfter(Float.NaN, NEXTAFTER_DD_FD_DIRECTION_CASES[i])));
+        }
+        assertTrue("The result should be NaN.", Float.isNaN(StrictMath
+                .nextAfter(Float.NaN, Float.NaN)));
+
+        // test for exception
+        try {
+            StrictMath.nextAfter((Float) null, 2.3);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
+        try {
+            StrictMath.nextAfter(2.3, (Float) null);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
+        try {
+            StrictMath.nextAfter((Float) null, (Float) null);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
     }
 
     /**
-     * @tests java.lang.StrictMath#max(int, int)
+     * @tests {@link java.lang.StrictMath#nextUp(double)}
+     * @since 1.6
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "max",
-        args = {int.class, int.class}
-    )
-    public void test_maxII() {
-        // Test for method int java.lang.StrictMath.max(int, int)
-        assertEquals("Incorrect int max value", 19088976, StrictMath.max(-19088976,
-                19088976));
-        assertEquals("Incorrect int max value",
-                19088976, StrictMath.max(20, 19088976));
-        assertEquals("Incorrect int max value",
-                -20, StrictMath.max(-20, -19088976));
-        assertEquals("Returned incorrect value.", Integer.MAX_VALUE, 
-                      StrictMath.max(Integer.MAX_VALUE, 1));  
-        assertEquals("Returned incorrect value.", Integer.MIN_VALUE, 
-                StrictMath.max(Integer.MIN_VALUE, Integer.MIN_VALUE));         
+    @SuppressWarnings("boxing")
+    public void test_nextUp_D() {
+        // This method is semantically equivalent to nextAfter(d,
+        // Double.POSITIVE_INFINITY),
+        // so we use the data of test_nextAfter_DD
+        for (int i = 0; i < NEXTAFTER_DD_START_CASES.length; i++) {
+            final double start = NEXTAFTER_DD_START_CASES[i][0];
+            final long nextUpBits = Double
+                    .doubleToLongBits(NEXTAFTER_DD_START_CASES[i][1]);
+            final long resultBits = Double.doubleToLongBits(StrictMath
+                    .nextUp(start));
+            assertEquals("Result should be next up-number.", nextUpBits,
+                    resultBits);
+        }
+
+        // test for cases with NaN
+        assertTrue("The result should be NaN.", Double.isNaN(StrictMath
+                .nextUp(Double.NaN)));
+
+        // test for exception
+        try {
+            StrictMath.nextUp((Double) null);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
     }
 
     /**
-     * @tests java.lang.StrictMath#max(long, long)
+     * @tests {@link java.lang.StrictMath#nextUp(float)}
+     * @since 1.6
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "max",
-        args = {long.class, long.class}
-    )
-    public void test_maxJJ() {
-        // Test for method long java.lang.StrictMath.max(long, long)
-        assertEquals("Incorrect long max value", 19088976000089L, StrictMath.max(-19088976000089L,
-                19088976000089L));
-        assertEquals("Incorrect long max value", 19088976000089L, StrictMath.max(20,
-                19088976000089L));
-        assertEquals("Incorrect long max value", -20, StrictMath.max(-20,
-                -19088976000089L));
-        
-        assertEquals("Returned incorrect value.", Long.MAX_VALUE, 
-                StrictMath.max(Long.MAX_VALUE, 1));  
-        assertEquals("Returned incorrect value.", Long.MIN_VALUE, 
-          StrictMath.max(Long.MIN_VALUE, Long.MIN_VALUE));         
+    @SuppressWarnings("boxing")
+    public void test_nextUp_F() {
+        // This method is semantically equivalent to nextAfter(f,
+        // Float.POSITIVE_INFINITY),
+        // so we use the data of test_nextAfter_FD
+        for (int i = 0; i < NEXTAFTER_FD_START_CASES.length; i++) {
+            final float start = NEXTAFTER_FD_START_CASES[i][0];
+            final int nextUpBits = Float
+                    .floatToIntBits(NEXTAFTER_FD_START_CASES[i][1]);
+            final int resultBits = Float.floatToIntBits(StrictMath
+                    .nextUp(start));
+            assertEquals("Result should be next up-number.", nextUpBits,
+                    resultBits);
+        }
+
+        // test for cases with NaN
+        assertTrue("The result should be NaN.", Float.isNaN(StrictMath
+                .nextUp(Float.NaN)));
+
+        // test for exception
+        try {
+            StrictMath.nextUp((Float) null);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
+    }
+
+	/**
+	 * @tests java.lang.StrictMath#pow(double, double)
+	 */
+	public void test_powDD() {
+		// Test for method double java.lang.StrictMath.pow(double, double)
+		assertTrue("pow returned incorrect value",
+				(long) StrictMath.pow(2, 8) == 256l);
+		assertTrue("pow returned incorrect value",
+				StrictMath.pow(2, -8) == 0.00390625d);
+	}
+
+	/**
+	 * @tests java.lang.StrictMath#rint(double)
+	 */
+	public void test_rintD() {
+		// Test for method double java.lang.StrictMath.rint(double)
+		assertEquals("Failed to round properly - up to odd",
+				3.0, StrictMath.rint(2.9), 0D);
+		assertTrue("Failed to round properly - NaN", Double.isNaN(StrictMath
+				.rint(Double.NaN)));
+		assertEquals("Failed to round properly down  to even", 2.0, StrictMath
+				.rint(2.1), 0D);
+		assertTrue("Failed to round properly " + 2.5 + " to even", StrictMath
+				.rint(2.5) == 2.0);
+	}
+
+	/**
+	 * @tests java.lang.StrictMath#round(double)
+	 */
+	public void test_roundD() {
+		// Test for method long java.lang.StrictMath.round(double)
+		assertEquals("Incorrect rounding of a float",
+				-91, StrictMath.round(-90.89d));
+	}
+
+	/**
+	 * @tests java.lang.StrictMath#round(float)
+	 */
+	public void test_roundF() {
+		// Test for method int java.lang.StrictMath.round(float)
+		assertEquals("Incorrect rounding of a float",
+				-91, StrictMath.round(-90.89f));
+	}
+    
+	/**
+     * @tests {@link java.lang.StrictMath#scalb(double, int)}
+     * @since 1.6
+     */
+    @SuppressWarnings("boxing")
+    public void test_scalb_DI() {
+        // result is normal
+        assertEquals(4.1422946304E7, StrictMath.scalb(1.2345, 25));
+        assertEquals(3.679096698760986E-8, StrictMath.scalb(1.2345, -25));
+        assertEquals(1.2345, StrictMath.scalb(1.2345, 0));
+        assertEquals(7868514.304, StrictMath.scalb(0.2345, 25));
+
+        double normal = StrictMath.scalb(0.2345, -25);
+        assertEquals(6.98864459991455E-9, normal);
+        // precision kept
+        assertEquals(0.2345, StrictMath.scalb(normal, 25));
+
+        assertEquals(0.2345, StrictMath.scalb(0.2345, 0));
+        assertEquals(-4.1422946304E7, StrictMath.scalb(-1.2345, 25));
+        assertEquals(-6.98864459991455E-9, StrictMath.scalb(-0.2345, -25));
+        assertEquals(2.0, StrictMath.scalb(Double.MIN_NORMAL / 2, 1024));
+        assertEquals(64.0, StrictMath.scalb(Double.MIN_VALUE, 1080));
+        assertEquals(234, StrictMath.getExponent(StrictMath.scalb(1.0, 234)));
+        assertEquals(3.9999999999999996, StrictMath.scalb(Double.MAX_VALUE,
+                Double.MIN_EXPONENT));
+
+        // result is near infinity
+        double halfMax = StrictMath.scalb(1.0, Double.MAX_EXPONENT);
+        assertEquals(8.98846567431158E307, halfMax);
+        assertEquals(Double.MAX_VALUE, halfMax - StrictMath.ulp(halfMax)
+                + halfMax);
+        assertEquals(Double.POSITIVE_INFINITY, halfMax + halfMax);
+        assertEquals(1.7976931348623155E308, StrictMath.scalb(1.0 - StrictMath
+                .ulp(1.0), Double.MAX_EXPONENT + 1));
+        assertEquals(Double.POSITIVE_INFINITY, StrictMath.scalb(
+                1.0 - StrictMath.ulp(1.0), Double.MAX_EXPONENT + 2));
+
+        halfMax = StrictMath.scalb(-1.0, Double.MAX_EXPONENT);
+        assertEquals(-8.98846567431158E307, halfMax);
+        assertEquals(-Double.MAX_VALUE, halfMax + StrictMath.ulp(halfMax)
+                + halfMax);
+        assertEquals(Double.NEGATIVE_INFINITY, halfMax + halfMax);
+
+        assertEquals(Double.POSITIVE_INFINITY, StrictMath.scalb(0.345, 1234));
+        assertEquals(Double.POSITIVE_INFINITY, StrictMath
+                .scalb(44.345E102, 934));
+        assertEquals(Double.NEGATIVE_INFINITY, StrictMath.scalb(-44.345E102,
+                934));
+
+        assertEquals(Double.POSITIVE_INFINITY, StrictMath.scalb(
+                Double.MIN_NORMAL / 2, 4000));
+        assertEquals(Double.POSITIVE_INFINITY, StrictMath.scalb(
+                Double.MIN_VALUE, 8000));
+        assertEquals(Double.POSITIVE_INFINITY, StrictMath.scalb(
+                Double.MAX_VALUE, 1));
+        assertEquals(Double.POSITIVE_INFINITY, StrictMath.scalb(
+                Double.POSITIVE_INFINITY, 0));
+        assertEquals(Double.POSITIVE_INFINITY, StrictMath.scalb(
+                Double.POSITIVE_INFINITY, -1));
+        assertEquals(Double.NEGATIVE_INFINITY, StrictMath.scalb(
+                Double.NEGATIVE_INFINITY, -1));
+        assertEquals(Double.NEGATIVE_INFINITY, StrictMath.scalb(
+                Double.NEGATIVE_INFINITY, Double.MIN_EXPONENT));
+
+        // result is subnormal/zero
+        long posZeroBits = Double.doubleToLongBits(+0.0);
+        long negZeroBits = Double.doubleToLongBits(-0.0);
+        assertEquals(posZeroBits, Double.doubleToLongBits(StrictMath.scalb(
+                +0.0, Integer.MAX_VALUE)));
+        assertEquals(posZeroBits, Double.doubleToLongBits(StrictMath.scalb(
+                +0.0, -123)));
+        assertEquals(posZeroBits, Double.doubleToLongBits(StrictMath.scalb(
+                +0.0, 0)));
+        assertEquals(negZeroBits, Double.doubleToLongBits(StrictMath.scalb(
+                -0.0, 123)));
+        assertEquals(negZeroBits, Double.doubleToLongBits(StrictMath.scalb(
+                -0.0, Integer.MIN_VALUE)));
+
+        assertEquals(Double.MIN_VALUE, StrictMath.scalb(1.0, -1074));
+        assertEquals(posZeroBits, Double.doubleToLongBits(StrictMath.scalb(1.0,
+                -1075)));
+        assertEquals(negZeroBits, Double.doubleToLongBits(StrictMath.scalb(
+                -1.0, -1075)));
+
+        // precision lost
+        assertEquals(StrictMath.scalb(21.405, -1078), StrictMath.scalb(21.405,
+                -1079));
+        assertEquals(Double.MIN_VALUE, StrictMath.scalb(21.405, -1079));
+        assertEquals(-Double.MIN_VALUE, StrictMath.scalb(-21.405, -1079));
+        assertEquals(posZeroBits, Double.doubleToLongBits(StrictMath.scalb(
+                21.405, -1080)));
+        assertEquals(negZeroBits, Double.doubleToLongBits(StrictMath.scalb(
+                -21.405, -1080)));
+        assertEquals(posZeroBits, Double.doubleToLongBits(StrictMath.scalb(
+                Double.MIN_VALUE, -1)));
+        assertEquals(negZeroBits, Double.doubleToLongBits(StrictMath.scalb(
+                -Double.MIN_VALUE, -1)));
+        assertEquals(Double.MIN_VALUE, StrictMath.scalb(Double.MIN_NORMAL, -52));
+        assertEquals(posZeroBits, Double.doubleToLongBits(StrictMath.scalb(
+                Double.MIN_NORMAL, -53)));
+        assertEquals(negZeroBits, Double.doubleToLongBits(StrictMath.scalb(
+                -Double.MIN_NORMAL, -53)));
+        assertEquals(Double.MIN_VALUE, StrictMath
+                .scalb(Double.MAX_VALUE, -2098));
+        assertEquals(posZeroBits, Double.doubleToLongBits(StrictMath.scalb(
+                Double.MAX_VALUE, -2099)));
+        assertEquals(negZeroBits, Double.doubleToLongBits(StrictMath.scalb(
+                -Double.MAX_VALUE, -2099)));
+        assertEquals(Double.MIN_VALUE, StrictMath.scalb(Double.MIN_NORMAL / 3,
+                -51));
+        assertEquals(posZeroBits, Double.doubleToLongBits(StrictMath.scalb(
+                Double.MIN_NORMAL / 3, -52)));
+        assertEquals(negZeroBits, Double.doubleToLongBits(StrictMath.scalb(
+                -Double.MIN_NORMAL / 3, -52)));
+        double subnormal = StrictMath.scalb(Double.MIN_NORMAL / 3, -25);
+        assertEquals(2.2104123E-316, subnormal);
+        // precision lost
+        assertFalse(Double.MIN_NORMAL / 3 == StrictMath.scalb(subnormal, 25));
+
+        // NaN
+        assertTrue(Double.isNaN(StrictMath.scalb(Double.NaN, 1)));
+        assertTrue(Double.isNaN(StrictMath.scalb(Double.NaN, 0)));
+        assertTrue(Double.isNaN(StrictMath.scalb(Double.NaN, -120)));
+
+        assertEquals(1283457024, Double.doubleToLongBits(StrictMath.scalb(
+                Double.MIN_VALUE * 153, 23)));
+        assertEquals(-9223372035571318784L, Double.doubleToLongBits(StrictMath
+                .scalb(-Double.MIN_VALUE * 153, 23)));
+        assertEquals(36908406321184768L, Double.doubleToLongBits(StrictMath
+                .scalb(Double.MIN_VALUE * 153, 52)));
+        assertEquals(-9186463630533591040L, Double.doubleToLongBits(StrictMath
+                .scalb(-Double.MIN_VALUE * 153, 52)));
+
+        // test for exception
+        try {
+            StrictMath.scalb((Double) null, (Integer) null);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
+        try {
+            StrictMath.scalb(1.0, (Integer) null);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
+        try {
+            StrictMath.scalb((Double) null, 1);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
     }
 
     /**
-     * @tests java.lang.StrictMath#min(double, double)
+     * @tests {@link java.lang.StrictMath#scalb(float, int)}
+     * @since 1.6
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "min",
-        args = {double.class, double.class}
-    )
-    public void test_minDD() {
-        // Test for method double java.lang.StrictMath.min(double, double)
-        assertEquals("Incorrect double min value", -1908897.6000089, StrictMath.min(
-                -1908897.6000089, 1908897.6000089), 0D);
-        assertEquals("Incorrect double min value", 2.0, StrictMath.min(2.0,
-                1908897.6000089), 0D);
-        assertEquals("Incorrect double min value", -1908897.6000089, StrictMath.min(-2.0,
-                -1908897.6000089), 0D);
-        assertEquals("Returned incorrect value.", Double.NaN, 
-                                               StrictMath.min(Double.NaN, 1.0));
-        assertEquals("Returned incorrect value.", Double.NaN, 
-                                               StrictMath.min(1.0, Double.NaN));      
-        assertEquals("Returned incorrect value.", -0.0, StrictMath.min(0.0, -0.0));  
-    }
+    @SuppressWarnings("boxing")
+    public void test_scalb_FI() {
+        // result is normal
+        assertEquals(4.1422946304E7f, StrictMath.scalb(1.2345f, 25));
+        assertEquals(3.679096698760986E-8f, StrictMath.scalb(1.2345f, -25));
+        assertEquals(1.2345f, StrictMath.scalb(1.2345f, 0));
+        assertEquals(7868514.304f, StrictMath.scalb(0.2345f, 25));
 
-    /**
-     * @tests java.lang.StrictMath#min(float, float)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "min",
-        args = {float.class, float.class}
-    )
-    public void test_minFF() {
-        // Test for method float java.lang.StrictMath.min(float, float)
-        assertTrue("Incorrect float min value", StrictMath.min(-1908897.600f,
-                1908897.600f) == -1908897.600f);
-        assertTrue("Incorrect float min value", StrictMath.min(2.0f,
-                1908897.600f) == 2.0f);
-        assertTrue("Incorrect float min value", StrictMath.min(-2.0f,
-                -1908897.600f) == -1908897.600f);
-        
-        assertEquals("Returned incorrect value.", Float.NaN, 
-                StrictMath.min(Float.NaN, 1f));
-        assertEquals("Returned incorrect value.", Float.NaN, 
-                StrictMath.min(1f, Float.NaN));      
-        assertEquals("Returned incorrect value.", -0f, StrictMath.min(0f, -0f));  
-    }
+        float normal = StrictMath.scalb(0.2345f, -25);
+        assertEquals(6.98864459991455E-9f, normal);
+        // precision kept
+        assertEquals(0.2345f, StrictMath.scalb(normal, 25));
 
-    /**
-     * @tests java.lang.StrictMath#min(int, int)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "min",
-        args = {int.class, int.class}
-    )
-    public void test_minII() {
-        // Test for method int java.lang.StrictMath.min(int, int)
-        assertEquals("Incorrect int min value", -19088976, StrictMath.min(-19088976,
-                19088976));
-        assertEquals("Incorrect int min value",
-                20, StrictMath.min(20, 19088976));
-        assertEquals("Incorrect int min value",
-                -19088976, StrictMath.min(-20, -19088976));
+        assertEquals(0.2345f, StrictMath.scalb(0.2345f, 0));
+        assertEquals(-4.1422946304E7f, StrictMath.scalb(-1.2345f, 25));
+        assertEquals(-6.98864459991455E-9f, StrictMath.scalb(-0.2345f, -25));
+        assertEquals(2.0f, StrictMath.scalb(Float.MIN_NORMAL / 2, 128));
+        assertEquals(64.0f, StrictMath.scalb(Float.MIN_VALUE, 155));
+        assertEquals(34, StrictMath.getExponent(StrictMath.scalb(1.0f, 34)));
+        assertEquals(3.9999998f, StrictMath.scalb(Float.MAX_VALUE,
+                Float.MIN_EXPONENT));
 
-        assertEquals("Incorrect value was returned.", Double.MIN_VALUE, 
-                StrictMath.min(Double.MIN_VALUE, Double.MIN_VALUE));
-    }
+        // result is near infinity
+        float halfMax = StrictMath.scalb(1.0f, Float.MAX_EXPONENT);
+        assertEquals(1.7014118E38f, halfMax);
+        assertEquals(Float.MAX_VALUE, halfMax - StrictMath.ulp(halfMax)
+                + halfMax);
+        assertEquals(Float.POSITIVE_INFINITY, halfMax + halfMax);
+        assertEquals(3.4028233E38f, StrictMath.scalb(1.0f - StrictMath
+                .ulp(1.0f), Float.MAX_EXPONENT + 1));
+        assertEquals(Float.POSITIVE_INFINITY, StrictMath.scalb(
+                1.0f - StrictMath.ulp(1.0f), Float.MAX_EXPONENT + 2));
 
-    /**
-     * @tests java.lang.StrictMath#min(long, long)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "min",
-        args = {long.class, long.class}
-    )
-    public void test_minJJ() {
-        // Test for method long java.lang.StrictMath.min(long, long)
-        assertEquals("Incorrect long min value", -19088976000089L, StrictMath.min(-19088976000089L,
-                19088976000089L));
-        assertEquals("Incorrect long min value", 20, StrictMath.min(20,
-                19088976000089L));
-        assertEquals("Incorrect long min value", -19088976000089L, StrictMath.min(-20,
-                -19088976000089L));
-        assertEquals("Incorrect value was returned.", Long.MIN_VALUE, 
-                StrictMath.min(Long.MIN_VALUE, Long.MIN_VALUE));        
-    }
+        halfMax = StrictMath.scalb(-1.0f, Float.MAX_EXPONENT);
+        assertEquals(-1.7014118E38f, halfMax);
+        assertEquals(-Float.MAX_VALUE, halfMax + StrictMath.ulp(halfMax)
+                + halfMax);
+        assertEquals(Float.NEGATIVE_INFINITY, halfMax + halfMax);
 
-    /**
-     * @tests java.lang.StrictMath#pow(double, double)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "pow",
-        args = {double.class, double.class}
-    )
-    public void test_powDD() {
-        // Test for method double java.lang.StrictMath.pow(double, double)
-        assertTrue("pow returned incorrect value",
-                (long) StrictMath.pow(2, 8) == 256l);
-        assertTrue("pow returned incorrect value",
-                StrictMath.pow(2, -8) == 0.00390625d);
-        
-        assertEquals(1.0, StrictMath.pow(1.0, 0.0));
-        assertEquals(1.0, StrictMath.pow(1.0, -0.0));
-        
-        assertEquals(Double.NaN, StrictMath.pow(1.0, Double.NaN));
-        assertEquals(Double.NaN, StrictMath.pow(Double.NaN, 1.0));  
-        
-        assertEquals(Double.POSITIVE_INFINITY, 
-                StrictMath.pow(1.1, Double.POSITIVE_INFINITY));
-        assertEquals(Double.POSITIVE_INFINITY, 
-                StrictMath.pow(0.1, Double.NEGATIVE_INFINITY));  
-        
-        assertEquals(0.0, StrictMath.pow(1.1, Double.NEGATIVE_INFINITY));
-        assertEquals(0.0, StrictMath.pow(0.1, Double.POSITIVE_INFINITY));
-        
-        assertEquals(Double.NaN, StrictMath.pow(1.0, Double.NEGATIVE_INFINITY));
-        assertEquals(Double.NaN, StrictMath.pow(1.0, Double.POSITIVE_INFINITY));
+        assertEquals(Float.POSITIVE_INFINITY, StrictMath.scalb(0.345f, 1234));
+        assertEquals(Float.POSITIVE_INFINITY, StrictMath.scalb(44.345E10f, 934));
+        assertEquals(Float.NEGATIVE_INFINITY, StrictMath
+                .scalb(-44.345E10f, 934));
 
-        assertEquals(0.0, StrictMath.pow(0.0, 1.0));
-        assertEquals(0.0, StrictMath.pow(Double.POSITIVE_INFINITY, -1.0));
-        
-        assertEquals(Double.POSITIVE_INFINITY, StrictMath.pow(0.0, -1.0));
-        assertEquals(Double.POSITIVE_INFINITY, 
-                StrictMath.pow(Double.POSITIVE_INFINITY, 1.0));
-        
-        assertEquals(0.0, StrictMath.pow(-0.0, 2.0));
-        assertEquals(0.0, StrictMath.pow(Double.NEGATIVE_INFINITY, -2.0));
-        
-        assertEquals(Double.POSITIVE_INFINITY, StrictMath.pow(-0.0, -2.0));
-        assertEquals(Double.POSITIVE_INFINITY, StrictMath.pow(
-                Double.NEGATIVE_INFINITY, 2.0)); 
-        
-        assertEquals(Double.NEGATIVE_INFINITY, StrictMath.pow(-0.0, -1.0));
-        assertEquals(Double.NEGATIVE_INFINITY, StrictMath.pow(
-                Double.NEGATIVE_INFINITY, 1.0));         
-        
-        assertEquals(Double.NaN, StrictMath.pow(-1.0, 1.1));       
-    }
+        assertEquals(Float.POSITIVE_INFINITY, StrictMath.scalb(
+                Float.MIN_NORMAL / 2, 400));
+        assertEquals(Float.POSITIVE_INFINITY, StrictMath.scalb(Float.MIN_VALUE,
+                800));
+        assertEquals(Float.POSITIVE_INFINITY, StrictMath.scalb(Float.MAX_VALUE,
+                1));
+        assertEquals(Float.POSITIVE_INFINITY, StrictMath.scalb(
+                Float.POSITIVE_INFINITY, 0));
+        assertEquals(Float.POSITIVE_INFINITY, StrictMath.scalb(
+                Float.POSITIVE_INFINITY, -1));
+        assertEquals(Float.NEGATIVE_INFINITY, StrictMath.scalb(
+                Float.NEGATIVE_INFINITY, -1));
+        assertEquals(Float.NEGATIVE_INFINITY, StrictMath.scalb(
+                Float.NEGATIVE_INFINITY, Float.MIN_EXPONENT));
 
-    /**
-     * @tests java.lang.StrictMath#rint(double)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "rint",
-        args = {double.class}
-    )
-    public void test_rintD() {
-        // Test for method double java.lang.StrictMath.rint(double)
-        assertEquals("Failed to round properly - up to odd",
-                3.0, StrictMath.rint(2.9), 0D);
-        assertTrue("Failed to round properly - NaN", Double.isNaN(StrictMath
-                .rint(Double.NaN)));
-        assertEquals("Failed to round properly down  to even", 2.0, StrictMath
-                .rint(2.1), 0D);
-        assertTrue("Failed to round properly " + 2.5 + " to even", StrictMath
-                .rint(2.5) == 2.0);
-    }
+        // result is subnormal/zero
+        int posZeroBits = Float.floatToIntBits(+0.0f);
+        int negZeroBits = Float.floatToIntBits(-0.0f);
+        assertEquals(posZeroBits, Float.floatToIntBits(StrictMath.scalb(+0.0f,
+                Integer.MAX_VALUE)));
+        assertEquals(posZeroBits, Float.floatToIntBits(StrictMath.scalb(+0.0f,
+                -123)));
+        assertEquals(posZeroBits, Float.floatToIntBits(StrictMath.scalb(+0.0f,
+                0)));
+        assertEquals(negZeroBits, Float.floatToIntBits(StrictMath.scalb(-0.0f,
+                123)));
+        assertEquals(negZeroBits, Float.floatToIntBits(StrictMath.scalb(-0.0f,
+                Integer.MIN_VALUE)));
 
-    /**
-     * @tests java.lang.StrictMath#round(double)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "round",
-        args = {double.class}
-    )
-    public void test_roundD() {
-        // Test for method long java.lang.StrictMath.round(double)
-        assertEquals("Incorrect rounding of a float",
-                -91, StrictMath.round(-90.89d));
-        
-        assertEquals("Incorrect rounding of NaN", 0l, 
-                                                  StrictMath.round(Double.NaN));
-        assertEquals("Incorrect rounding of NEGATIVE_INFINITY", Long.MIN_VALUE, 
-                                    StrictMath.round(Double.NEGATIVE_INFINITY));
-        assertEquals("Incorrect rounding of value less than Long.MIN_VALUE", 
-            Long.MIN_VALUE, StrictMath.round(new Double(Long.MIN_VALUE - 0.1)));   
-        assertEquals("Incorrect rounding of Long.MIN_VALUE", 
-                Long.MIN_VALUE, StrictMath.round(new Double(Long.MIN_VALUE))); 
-        assertEquals("Incorrect rounding of Long.MAX_VALUE", 
-                Long.MAX_VALUE, StrictMath.round(Double.POSITIVE_INFINITY));  
-        assertEquals("Incorrect rounding of value greater than Long.MAX_VALUE", 
-            Long.MAX_VALUE, StrictMath.round(new Double(Long.MAX_VALUE + 0.1)));        
-        
-    }
+        assertEquals(Float.MIN_VALUE, StrictMath.scalb(1.0f, -149));
+        assertEquals(posZeroBits, Float.floatToIntBits(StrictMath.scalb(1.0f,
+                -150)));
+        assertEquals(negZeroBits, Float.floatToIntBits(StrictMath.scalb(-1.0f,
+                -150)));
 
-    /**
-     * @tests java.lang.StrictMath#round(float)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "round",
-        args = {float.class}
-    )
-    public void test_roundF() {
-        // Test for method int java.lang.StrictMath.round(float)
-        assertEquals("Incorrect rounding of a float",
-                -91, StrictMath.round(-90.89f));
-        
-        assertEquals("Incorrect rounding of NaN", 0l, 
-                        StrictMath.round(Float.NaN));
-        assertEquals("Incorrect rounding of NEGATIVE_INFINITY", 
-                  Integer.MIN_VALUE, StrictMath.round(Float.NEGATIVE_INFINITY));
-        assertEquals("Incorrect rounding of value less than Integer.MIN_VALUE", 
-        Integer.MIN_VALUE, StrictMath.round(new Float(Integer.MIN_VALUE - 0.1)));   
-        assertEquals("Incorrect rounding of Integer.MIN_VALUE", 
-        Integer.MIN_VALUE, StrictMath.round(new Float(Integer.MIN_VALUE))); 
-        assertEquals("Incorrect rounding of Integer.MAX_VALUE", 
-        Integer.MAX_VALUE, StrictMath.round(Float.POSITIVE_INFINITY));  
-        assertEquals("Incorrect rounding of value greater than Integer.MAX_VALUE", 
-        Integer.MAX_VALUE, StrictMath.round(new Float(Integer.MAX_VALUE + 0.1)));
+        // precision lost
+        assertEquals(StrictMath.scalb(21.405f, -154), StrictMath.scalb(21.405f,
+                -153));
+        assertEquals(Float.MIN_VALUE, StrictMath.scalb(21.405f, -154));
+        assertEquals(-Float.MIN_VALUE, StrictMath.scalb(-21.405f, -154));
+        assertEquals(posZeroBits, Float.floatToIntBits(StrictMath.scalb(
+                21.405f, -155)));
+        assertEquals(negZeroBits, Float.floatToIntBits(StrictMath.scalb(
+                -21.405f, -155)));
+        assertEquals(posZeroBits, Float.floatToIntBits(StrictMath.scalb(
+                Float.MIN_VALUE, -1)));
+        assertEquals(negZeroBits, Float.floatToIntBits(StrictMath.scalb(
+                -Float.MIN_VALUE, -1)));
+        assertEquals(Float.MIN_VALUE, StrictMath.scalb(Float.MIN_NORMAL, -23));
+        assertEquals(posZeroBits, Float.floatToIntBits(StrictMath.scalb(
+                Float.MIN_NORMAL, -24)));
+        assertEquals(negZeroBits, Float.floatToIntBits(StrictMath.scalb(
+                -Float.MIN_NORMAL, -24)));
+        assertEquals(Float.MIN_VALUE, StrictMath.scalb(Float.MAX_VALUE, -277));
+        assertEquals(posZeroBits, Float.floatToIntBits(StrictMath.scalb(
+                Float.MAX_VALUE, -278)));
+        assertEquals(negZeroBits, Float.floatToIntBits(StrictMath.scalb(
+                -Float.MAX_VALUE, -278)));
+        assertEquals(Float.MIN_VALUE, StrictMath.scalb(Float.MIN_NORMAL / 3,
+                -22));
+        assertEquals(posZeroBits, Float.floatToIntBits(StrictMath.scalb(
+                Float.MIN_NORMAL / 3, -23)));
+        assertEquals(negZeroBits, Float.floatToIntBits(StrictMath.scalb(
+                -Float.MIN_NORMAL / 3, -23)));
+        float subnormal = StrictMath.scalb(Float.MIN_NORMAL / 3, -11);
+        assertEquals(1.913E-42f, subnormal);
+        // precision lost
+        assertFalse(Float.MIN_NORMAL / 3 == StrictMath.scalb(subnormal, 11));
+
+        assertEquals(68747264, Float.floatToIntBits(StrictMath.scalb(
+                Float.MIN_VALUE * 153, 23)));
+        assertEquals(-2078736384, Float.floatToIntBits(StrictMath.scalb(
+                -Float.MIN_VALUE * 153, 23)));
+
+        assertEquals(4896, Float.floatToIntBits(StrictMath.scalb(
+                Float.MIN_VALUE * 153, 5)));
+        assertEquals(-2147478752, Float.floatToIntBits(StrictMath.scalb(
+                -Float.MIN_VALUE * 153, 5)));
+
+        // NaN
+        assertTrue(Float.isNaN(StrictMath.scalb(Float.NaN, 1)));
+        assertTrue(Float.isNaN(StrictMath.scalb(Float.NaN, 0)));
+        assertTrue(Float.isNaN(StrictMath.scalb(Float.NaN, -120)));
+
+        // test for exception
+        try {
+            StrictMath.scalb((Float) null, (Integer) null);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
+        try {
+            StrictMath.scalb(1.0f, (Integer) null);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
+        try {
+            StrictMath.scalb((Float) null, 1);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
     }
     
     /**
      * @tests java.lang.StrictMath#signum(double)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "signum",
-        args = {double.class}
-    )
     public void test_signum_D() {
         assertTrue(Double.isNaN(StrictMath.signum(Double.NaN)));
         assertEquals(Double.doubleToLongBits(0.0), Double
@@ -1142,12 +1260,6 @@
     /**
      * @tests java.lang.StrictMath#signum(float)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "signum",
-        args = {float.class}
-    )
     public void test_signum_F() {
         assertTrue(Float.isNaN(StrictMath.signum(Float.NaN)));
         assertEquals(Float.floatToIntBits(0.0f), Float
@@ -1170,44 +1282,18 @@
         assertEquals(-1.0f, StrictMath.signum(Float.NEGATIVE_INFINITY), 0f);
     }
 
-    /**
+	/**
      * @tests java.lang.StrictMath#sin(double)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "sin",
-        args = {double.class}
-    )
-    public void test_sinD() {
-        // Test for method double java.lang.StrictMath.sin(double)
-        assertTrue("Returned incorrect sine", StrictMath.sin(StrictMath
-                .asin(OPP / HYP)) == OPP / HYP);
-        
-        assertEquals("Returned incorrect sin value.", 
-                Double.NaN, StrictMath.sin(Double.NaN));
-        
-        assertEquals("Returned incorrect sin value.", 
-                Double.NaN, StrictMath.sin(Double.POSITIVE_INFINITY));
-        
-        assertEquals("Returned incorrect sin value.", 
-                Double.NaN, StrictMath.sin(Double.NEGATIVE_INFINITY));   
-        
-        assertEquals("Returned incorrect sin value.", 
-                0.0, StrictMath.sin(0.0));   
-        assertEquals("Returned incorrect sin value.", 
-                -0.0, StrictMath.sin(-0.0));        
-    }
+	public void test_sinD() {
+		// Test for method double java.lang.StrictMath.sin(double)
+		assertTrue("Returned incorrect sine", StrictMath.sin(StrictMath
+				.asin(OPP / HYP)) == OPP / HYP);
+	}
 
     /**
      * @tests java.lang.StrictMath#sinh(double)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "sinh",
-        args = {double.class}
-    )
     public void test_sinh_D() {
         // Test for special situations
         assertTrue(Double.isNaN(StrictMath.sinh(Double.NaN)));
@@ -1218,11 +1304,11 @@
                 Double.NEGATIVE_INFINITY, StrictMath
                         .sinh(Double.NEGATIVE_INFINITY), 0D);
         assertEquals(Double.doubleToLongBits(0.0), Double
-                .doubleToLongBits(StrictMath.sinh(0.0)));
-        assertEquals(Double.doubleToLongBits(+0.0), Double
-                .doubleToLongBits(StrictMath.sinh(+0.0)));
-        assertEquals(Double.doubleToLongBits(-0.0), Double
-                .doubleToLongBits(StrictMath.sinh(-0.0)));
+				.doubleToLongBits(StrictMath.sinh(0.0)));
+		assertEquals(Double.doubleToLongBits(+0.0), Double
+				.doubleToLongBits(StrictMath.sinh(+0.0)));
+		assertEquals(Double.doubleToLongBits(-0.0), Double
+				.doubleToLongBits(StrictMath.sinh(-0.0)));
 
         assertEquals("Should return POSITIVE_INFINITY",
                 Double.POSITIVE_INFINITY, StrictMath.sinh(1234.56), 0D);
@@ -1240,58 +1326,30 @@
                 .sinh(Double.MIN_VALUE), 0D);
     }
     
-    /**
-     * @tests java.lang.StrictMath#sqrt(double)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "sqrt",
-        args = {double.class}
-    )
-    public void test_sqrtD() {
-        // Test for method double java.lang.StrictMath.sqrt(double)
-        assertEquals("Incorrect root returned1",
+	/**
+	 * @tests java.lang.StrictMath#sqrt(double)
+	 */
+	public void test_sqrtD() {
+		// Test for method double java.lang.StrictMath.sqrt(double)
+		assertEquals("Incorrect root returned1",
                              2, StrictMath.sqrt(StrictMath.pow(StrictMath.sqrt(2), 4)), 0.0);
-        assertEquals("Incorrect root returned2", 7, StrictMath.sqrt(49), 0.0);
-        
-        assertEquals("Incorrect root was returned.", Double.NaN, 
-                StrictMath.sqrt(Double.NaN));
-        assertEquals("Incorrect root was returned.", Double.NaN, 
-                StrictMath.sqrt(-0.1));        
-        assertEquals("Incorrect root was returned.", Double.POSITIVE_INFINITY, 
-                StrictMath.sqrt(Double.POSITIVE_INFINITY)); 
-        
-        assertEquals("Incorrect root was returned.", 0.0, StrictMath.sqrt(0.0));     
-        assertEquals("Incorrect root was returned.", -0.0, StrictMath.sqrt(-0.0));       
-    }
+		assertEquals("Incorrect root returned2", 7, StrictMath.sqrt(49), 0.0);
+	}
 
-    /**
-     * @tests java.lang.StrictMath#tan(double)
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't check boundary values.",
-        method = "tan",
-        args = {double.class}
-    )
-    public void test_tanD() {
-        // Test for method double java.lang.StrictMath.tan(double)
-        assertTrue(
-                "Returned incorrect tangent: ",
-                StrictMath.tan(StrictMath.atan(1.0)) <= 1.0
-                        || StrictMath.tan(StrictMath.atan(1.0)) >= 9.9999999999999983E-1);
-    }
+	/**
+	 * @tests java.lang.StrictMath#tan(double)
+	 */
+	public void test_tanD() {
+		// Test for method double java.lang.StrictMath.tan(double)
+		assertTrue(
+				"Returned incorrect tangent: ",
+				StrictMath.tan(StrictMath.atan(1.0)) <= 1.0
+						|| StrictMath.tan(StrictMath.atan(1.0)) >= 9.9999999999999983E-1);
+	}
 
     /**
      * @tests java.lang.StrictMath#tanh(double)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "tanh",
-        args = {double.class}
-    )
     public void test_tanh_D() {
         // Test for special situations
         assertTrue(Double.isNaN(StrictMath.tanh(Double.NaN)));
@@ -1300,11 +1358,11 @@
         assertEquals("Should return -1.0", -1.0, StrictMath
                 .tanh(Double.NEGATIVE_INFINITY), 0D);
         assertEquals(Double.doubleToLongBits(0.0), Double
-                .doubleToLongBits(StrictMath.tanh(0.0)));
-        assertEquals(Double.doubleToLongBits(+0.0), Double
-                .doubleToLongBits(StrictMath.tanh(+0.0)));
-        assertEquals(Double.doubleToLongBits(-0.0), Double
-                .doubleToLongBits(StrictMath.tanh(-0.0)));
+				.doubleToLongBits(StrictMath.tanh(0.0)));
+		assertEquals(Double.doubleToLongBits(+0.0), Double
+				.doubleToLongBits(StrictMath.tanh(+0.0)));
+		assertEquals(Double.doubleToLongBits(-0.0), Double
+				.doubleToLongBits(StrictMath.tanh(-0.0)));
 
         assertEquals("Should return 1.0", 1.0, StrictMath.tanh(1234.56), 0D);
         assertEquals("Should return -1.0", -1.0, StrictMath.tanh(-1234.56), 0D);
@@ -1318,172 +1376,115 @@
                 .tanh(Double.MIN_VALUE), 0D);
     }
     
-    /**
-     * @tests java.lang.StrictMath#random()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "random",
-        args = {}
-    )
-    public void test_random() {
-        // There isn't a place for these tests so just stick them here
-        assertEquals("Wrong value E",
-                4613303445314885481L, Double.doubleToLongBits(StrictMath.E));
-        assertEquals("Wrong value PI",
-                4614256656552045848L, Double.doubleToLongBits(StrictMath.PI));
+	/**
+	 * @tests java.lang.StrictMath#random()
+	 */
+	public void test_random() {
+		// There isn't a place for these tests so just stick them here
+		assertEquals("Wrong value E",
+				4613303445314885481L, Double.doubleToLongBits(StrictMath.E));
+		assertEquals("Wrong value PI",
+				4614256656552045848L, Double.doubleToLongBits(StrictMath.PI));
 
-        for (int i = 500; i >= 0; i--) {
-            double d = StrictMath.random();
-            assertTrue("Generated number is out of range: " + d, d >= 0.0
-                    && d < 1.0);
-        }
-    }
+		for (int i = 500; i >= 0; i--) {
+			double d = StrictMath.random();
+			assertTrue("Generated number is out of range: " + d, d >= 0.0
+					&& d < 1.0);
+		}
+	}
 
-    /**
-     * @tests java.lang.StrictMath#toRadians(double)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toRadians",
-        args = {double.class}
-    )
-    public void test_toRadiansD() {
-        for (double d = 500; d >= 0; d -= 1.0) {
-            double converted = StrictMath.toDegrees(StrictMath.toRadians(d));
-            assertTrue("Converted number not equal to original. d = " + d,
-                    converted >= d * 0.99999999 && converted <= d * 1.00000001);
-        }
-    }
+	/**
+	 * @tests java.lang.StrictMath#toRadians(double)
+	 */
+	public void test_toRadiansD() {
+		for (double d = 500; d >= 0; d -= 1.0) {
+			double converted = StrictMath.toDegrees(StrictMath.toRadians(d));
+			assertTrue("Converted number not equal to original. d = " + d,
+					converted >= d * 0.99999999 && converted <= d * 1.00000001);
+		}
+	}
 
-    /**
-     * @tests java.lang.StrictMath#toDegrees(double)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toDegrees",
-        args = {double.class}
-    )
-    public void test_toDegreesD() {
-        for (double d = 500; d >= 0; d -= 1.0) {
-            double converted = StrictMath.toRadians(StrictMath.toDegrees(d));
-            assertTrue("Converted number not equal to original. d = " + d,
-                    converted >= d * 0.99999999 && converted <= d * 1.00000001);
-        }
-    }
-    
-    /**
+	/**
+	 * @tests java.lang.StrictMath#toDegrees(double)
+	 */
+	public void test_toDegreesD() {
+		for (double d = 500; d >= 0; d -= 1.0) {
+			double converted = StrictMath.toRadians(StrictMath.toDegrees(d));
+			assertTrue("Converted number not equal to original. d = " + d,
+					converted >= d * 0.99999999 && converted <= d * 1.00000001);
+		}
+	}
+	
+	/**
      * @tests java.lang.StrictMath#ulp(double)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "ulp",
-        args = {double.class}
-    )
      @SuppressWarnings("boxing")
     public void test_ulp_D() {
         // Test for special cases
-        assertTrue("Should return NaN", Double
-                .isNaN(StrictMath.ulp(Double.NaN)));
-        assertEquals("Returned incorrect value", Double.POSITIVE_INFINITY,
-                StrictMath.ulp(Double.POSITIVE_INFINITY), 0D);
-        assertEquals("Returned incorrect value", Double.POSITIVE_INFINITY,
-                StrictMath.ulp(Double.NEGATIVE_INFINITY), 0D);
-        assertEquals("Returned incorrect value", Double.MIN_VALUE, StrictMath
-                .ulp(0.0), 0D);
-        assertEquals("Returned incorrect value", Double.MIN_VALUE, StrictMath
-                .ulp(+0.0), 0D);
-        assertEquals("Returned incorrect value", Double.MIN_VALUE, StrictMath
-                .ulp(-0.0), 0D);
-        assertEquals("Returned incorrect value", StrictMath.pow(2, 971),
-                StrictMath.ulp(Double.MAX_VALUE), 0D);
-        assertEquals("Returned incorrect value", StrictMath.pow(2, 971),
-                StrictMath.ulp(-Double.MAX_VALUE), 0D);
+		assertTrue("Should return NaN", Double
+				.isNaN(StrictMath.ulp(Double.NaN)));
+		assertEquals("Returned incorrect value", Double.POSITIVE_INFINITY,
+				StrictMath.ulp(Double.POSITIVE_INFINITY), 0D);
+		assertEquals("Returned incorrect value", Double.POSITIVE_INFINITY,
+				StrictMath.ulp(Double.NEGATIVE_INFINITY), 0D);
+		assertEquals("Returned incorrect value", Double.MIN_VALUE, StrictMath
+				.ulp(0.0), 0D);
+		assertEquals("Returned incorrect value", Double.MIN_VALUE, StrictMath
+				.ulp(+0.0), 0D);
+		assertEquals("Returned incorrect value", Double.MIN_VALUE, StrictMath
+				.ulp(-0.0), 0D);
+		assertEquals("Returned incorrect value", StrictMath.pow(2, 971),
+				StrictMath.ulp(Double.MAX_VALUE), 0D);
+		assertEquals("Returned incorrect value", StrictMath.pow(2, 971),
+				StrictMath.ulp(-Double.MAX_VALUE), 0D);
 
-        assertEquals("Returned incorrect value", Double.MIN_VALUE, StrictMath
-                .ulp(Double.MIN_VALUE), 0D);
-        assertEquals("Returned incorrect value", Double.MIN_VALUE, StrictMath
-                .ulp(-Double.MIN_VALUE), 0D);
+		assertEquals("Returned incorrect value", Double.MIN_VALUE, StrictMath
+				.ulp(Double.MIN_VALUE), 0D);
+		assertEquals("Returned incorrect value", Double.MIN_VALUE, StrictMath
+				.ulp(-Double.MIN_VALUE), 0D);
 
-        assertEquals("Returned incorrect value", 2.220446049250313E-16,
-                StrictMath.ulp(1.0), 0D);
-        assertEquals("Returned incorrect value", 2.220446049250313E-16,
-                StrictMath.ulp(-1.0), 0D);
-        assertEquals("Returned incorrect value", 2.2737367544323206E-13,
-                StrictMath.ulp(1153.0), 0D);
+		assertEquals("Returned incorrect value", 2.220446049250313E-16,
+				StrictMath.ulp(1.0), 0D);
+		assertEquals("Returned incorrect value", 2.220446049250313E-16,
+				StrictMath.ulp(-1.0), 0D);
+		assertEquals("Returned incorrect value", 2.2737367544323206E-13,
+				StrictMath.ulp(1153.0), 0D);
     }
 
     /**
-     * @tests java.lang.StrictMath#ulp(float)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "ulp",
-        args = {float.class}
-    )
+	 * @tests java.lang.StrictMath#ulp(float)
+	 */
     @SuppressWarnings("boxing")
     public void test_ulp_f() {
         // Test for special cases
-        assertTrue("Should return NaN", Float.isNaN(StrictMath.ulp(Float.NaN)));
-        assertEquals("Returned incorrect value", Float.POSITIVE_INFINITY,
-                StrictMath.ulp(Float.POSITIVE_INFINITY), 0f);
-        assertEquals("Returned incorrect value", Float.POSITIVE_INFINITY,
-                StrictMath.ulp(Float.NEGATIVE_INFINITY), 0f);
-        assertEquals("Returned incorrect value", Float.MIN_VALUE, StrictMath
-                .ulp(0.0f), 0f);
-        assertEquals("Returned incorrect value", Float.MIN_VALUE, StrictMath
-                .ulp(+0.0f), 0f);
-        assertEquals("Returned incorrect value", Float.MIN_VALUE, StrictMath
-                .ulp(-0.0f), 0f);
-        assertEquals("Returned incorrect value", 2.028241E31f, StrictMath
-                .ulp(Float.MAX_VALUE), 0f);
-        assertEquals("Returned incorrect value", 2.028241E31f, StrictMath
-                .ulp(-Float.MAX_VALUE), 0f);
+    	assertTrue("Should return NaN", Float.isNaN(StrictMath.ulp(Float.NaN)));
+		assertEquals("Returned incorrect value", Float.POSITIVE_INFINITY,
+				StrictMath.ulp(Float.POSITIVE_INFINITY), 0f);
+		assertEquals("Returned incorrect value", Float.POSITIVE_INFINITY,
+				StrictMath.ulp(Float.NEGATIVE_INFINITY), 0f);
+		assertEquals("Returned incorrect value", Float.MIN_VALUE, StrictMath
+				.ulp(0.0f), 0f);
+		assertEquals("Returned incorrect value", Float.MIN_VALUE, StrictMath
+				.ulp(+0.0f), 0f);
+		assertEquals("Returned incorrect value", Float.MIN_VALUE, StrictMath
+				.ulp(-0.0f), 0f);
+		assertEquals("Returned incorrect value", 2.028241E31f, StrictMath
+				.ulp(Float.MAX_VALUE), 0f);
+		assertEquals("Returned incorrect value", 2.028241E31f, StrictMath
+				.ulp(-Float.MAX_VALUE), 0f);
 
-        assertEquals("Returned incorrect value", 1.4E-45f, StrictMath
-                .ulp(Float.MIN_VALUE), 0f);
-        assertEquals("Returned incorrect value", 1.4E-45f, StrictMath
-                .ulp(-Float.MIN_VALUE), 0f);
+		assertEquals("Returned incorrect value", 1.4E-45f, StrictMath
+				.ulp(Float.MIN_VALUE), 0f);
+		assertEquals("Returned incorrect value", 1.4E-45f, StrictMath
+				.ulp(-Float.MIN_VALUE), 0f);
 
-        assertEquals("Returned incorrect value", 1.1920929E-7f, StrictMath
-                .ulp(1.0f), 0f);
-        assertEquals("Returned incorrect value", 1.1920929E-7f, StrictMath
-                .ulp(-1.0f), 0f);
-        assertEquals("Returned incorrect value", 1.2207031E-4f, StrictMath
-                .ulp(1153.0f), 0f);
-        assertEquals("Returned incorrect value", 5.6E-45f, Math
-                .ulp(9.403954E-38f), 0f);
+		assertEquals("Returned incorrect value", 1.1920929E-7f, StrictMath
+				.ulp(1.0f), 0f);
+		assertEquals("Returned incorrect value", 1.1920929E-7f, StrictMath
+				.ulp(-1.0f), 0f);
+		assertEquals("Returned incorrect value", 1.2207031E-4f, StrictMath
+				.ulp(1153.0f), 0f);
+		assertEquals("Returned incorrect value", 5.6E-45f, Math
+				.ulp(9.403954E-38f), 0f);
     }
-    
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Stress test.",
-        method = "pow",
-        args = {double.class, double.class}
-    )
-    public void test_pow_stress() {
-        assertTrue(Double.longBitsToDouble(-4610068591539890326L) ==
-                StrictMath.pow(-1.0000000000000002e+00,
-                        4.5035996273704970e+15));
-        assertTrue(Double.longBitsToDouble(4601023824101950163L) == 
-                StrictMath.pow(-9.9999999999999978e-01,
-                        4.035996273704970e+15));
-    }
-    
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Stress test.",
-        method = "tan",
-        args = {double.class}
-    )
-    public void test_tan_stress(){
-        assertTrue(Double.longBitsToDouble(4850236541654588678L) == 
-            StrictMath.tan(1.7765241907548024E+269));
-    }
-    
 }