harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r787991 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Math.java
Date Wed, 24 Jun 2009 12:06:48 GMT
Author: tellison
Date: Wed Jun 24 12:06:48 2009
New Revision: 787991

URL: http://svn.apache.org/viewvc?rev=787991&view=rev
Log:
Code tidy-up (formatting, adding braces, etc.). No functional changes.

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Math.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Math.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Math.java?rev=787991&r1=787990&r2=787991&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Math.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Math.java Wed Jun
24 12:06:48 2009
@@ -17,7 +17,6 @@
 
 package java.lang;
 
-
 /**
  * Class Math provides basic math constants and operations such as trigonometric
  * functions, hyperbolic functions, exponential, logarithms, etc.
@@ -53,16 +52,16 @@
      * <li>{@code abs(-infinity) = +infinity}</li>
      * <li>{@code abs(NaN) = NaN}</li>
      * </ul>
-     *
+     * 
      * @param d
      *            the value whose absolute value has to be computed.
      * @return the absolute value of the argument.
      */
-	public static double abs(double d) {
-		long bits = Double.doubleToLongBits(d);
-		bits &= 0x7fffffffffffffffL;
-		return Double.longBitsToDouble(bits);
-	}
+    public static double abs(double d) {
+        long bits = Double.doubleToLongBits(d);
+        bits &= 0x7fffffffffffffffL;
+        return Double.longBitsToDouble(bits);
+    }
 
     /**
      * Returns the absolute value of the argument.
@@ -74,45 +73,45 @@
      * <li>{@code abs(-infinity) = +infinity}</li>
      * <li>{@code abs(NaN) = NaN}</li>
      * </ul>
-     *
+     * 
      * @param f
      *            the value whose absolute value has to be computed.
      * @return the argument if it is positive, otherwise the negation of the
      *         argument.
      */
-	public static float abs(float f) {
-		int bits = Float.floatToIntBits(f);
-		bits &= 0x7fffffff;
-		return Float.intBitsToFloat(bits);
-	}
+    public static float abs(float f) {
+        int bits = Float.floatToIntBits(f);
+        bits &= 0x7fffffff;
+        return Float.intBitsToFloat(bits);
+    }
 
     /**
      * Returns the absolute value of the argument.
      * <p>
      * If the argument is {@code Integer.MIN_VALUE}, {@code Integer.MIN_VALUE}
      * is returned.
-     *
+     * 
      * @param i
      *            the value whose absolute value has to be computed.
      * @return the argument if it is positive, otherwise the negation of the
      *         argument.
      */
-	public static int abs(int i) {
-		return i >= 0 ? i : -i;
-	}
+    public static int abs(int i) {
+        return i >= 0 ? i : -i;
+    }
 
     /**
      * Returns the absolute value of the argument. If the argument is {@code
      * Long.MIN_VALUE}, {@code Long.MIN_VALUE} is returned.
-     *
+     * 
      * @param l
      *            the value whose absolute value has to be computed.
      * @return the argument if it is positive, otherwise the negation of the
      *         argument.
      */
-	public static long abs(long l) {
-		return l >= 0 ? l : -l;
-	}
+    public static long abs(long l) {
+        return l >= 0 ? l : -l;
+    }
 
     /**
      * Returns the closest double approximation of the arc cosine of the
@@ -125,12 +124,12 @@
      * <li>{@code acos((anything < -1) = NaN}</li>
      * <li>{@code acos(NaN) = NaN}</li>
      * </ul>
-     *
+     * 
      * @param d
      *            the value to compute arc cosine of.
      * @return the arc cosine of the argument.
      */
-	public static native double acos(double d);
+    public static native double acos(double d);
 
     /**
      * Returns the closest double approximation of the arc sine of the argument
@@ -143,12 +142,12 @@
      * <li>{@code asin((anything < -1)) = NaN}</li>
      * <li>{@code asin(NaN) = NaN}</li>
      * </ul>
-     *
+     * 
      * @param d
      *            the value whose arc sine has to be computed.
      * @return the arc sine of the argument.
      */
-	public static native double asin(double d);
+    public static native double asin(double d);
 
     /**
      * Returns the closest double approximation of the arc tangent of the
@@ -163,7 +162,7 @@
      * <li>{@code atan(-infinity) = -pi/2}</li>
      * <li>{@code atan(NaN) = NaN}</li>
      * </ul>
-     *
+     * 
      * @param d
      *            the value whose arc tangent has to be computed.
      * @return the arc tangent of the argument.
@@ -171,10 +170,10 @@
     public static native double atan(double d);
 
     /**
-     * Returns the closest double approximation of the arc tangent of
-     * {@code y/x} within the range {@code [-pi..pi]}. This is the angle of the
-     * polar representation of the rectangular coordinates (x,y). The returned
-     * result is within 2 ulps (units in the last place) of the real result.
+     * Returns the closest double approximation of the arc tangent of {@code
+     * y/x} within the range {@code [-pi..pi]}. This is the angle of the polar
+     * representation of the rectangular coordinates (x,y). The returned result
+     * is within 2 ulps (units in the last place) of the real result.
      * <p>
      * Special cases:
      * <ul>
@@ -196,12 +195,12 @@
      * <li>{@code atan2(-infinity, +infinity ) = -pi/4}</li>
      * <li>{@code atan2(+infinity, -infinity ) = +3pi/4}</li>
      * <li>{@code atan2(-infinity, -infinity ) = -3pi/4}</li>
-     * <li>{@code atan2(+infinity, (anything but,0, NaN, and infinity))}
-     * {@code =} {@code +pi/2}</li>
-     * <li>{@code atan2(-infinity, (anything but,0, NaN, and infinity))}
-     * {@code =} {@code -pi/2}</li>
+     * <li>{@code atan2(+infinity, (anything but,0, NaN, and infinity))} {@code
+     * =} {@code +pi/2}</li>
+     * <li>{@code atan2(-infinity, (anything but,0, NaN, and infinity))} {@code
+     * =} {@code -pi/2}</li>
      * </ul>
-     *
+     * 
      * @param y
      *            the numerator of the value whose atan has to be computed.
      * @param x
@@ -209,7 +208,7 @@
      * @return the arc tangent of {@code y/x}.
      */
     public static native double atan2(double x, double y);
-    
+
     /**
      * Returns the closest double approximation of the cube root of the
      * argument.
@@ -222,7 +221,7 @@
      * <li>{@code cbrt(-infinity) = -infinity}</li>
      * <li>{@code cbrt(NaN) = NaN}</li>
      * </ul>
-     *
+     * 
      * @param d
      *            the value whose cube root has to be computed.
      * @return the cube root of the argument.
@@ -230,8 +229,8 @@
     public static native double cbrt(double d);
 
     /**
-     * Returns the double conversion of the most negative (closest to
-     * negative infinity) integer value which is greater than the argument.
+     * Returns the double conversion of the most negative (closest to negative
+     * infinity) integer value which is greater than the argument.
      * <p>
      * Special cases:
      * <ul>
@@ -242,16 +241,16 @@
      * <li>{@code ceil(-infinity) = -infinity}</li>
      * <li>{@code ceil(NaN) = NaN}</li>
      * </ul>
-     *
+     * 
      * @param d
      *            the value whose closest integer value has to be computed.
      * @return the ceiling of the argument.
      */
-	public static double ceil(double d) {
-            return -floor(-d);
-        } 
+    public static double ceil(double d) {
+        return -floor(-d);
+    }
 
-	/**
+    /**
      * Returns the closest double approximation of the cosine of the argument.
      * The returned result is within 1 ulp (unit in the last place) of the real
      * result.
@@ -262,13 +261,13 @@
      * <li>{@code cos(-infinity) = NaN}</li>
      * <li>{@code cos(NaN) = NaN}</li>
      * </ul>
-     *
+     * 
      * @param d
      *            the angle whose cosine has to be computed, in radians.
      * @return the cosine of the argument.
      */
     public static native double cos(double d);
-    
+
     /**
      * Returns the closest double approximation of the hyperbolic cosine of the
      * argument. The returned result is within 2.5 ulps (units in the last
@@ -280,7 +279,7 @@
      * <li>{@code cosh(-infinity) = +infinity}</li>
      * <li>{@code cosh(NaN) = NaN}</li>
      * </ul>
-     *
+     * 
      * @param d
      *            the value whose hyperbolic cosine has to be computed.
      * @return the hyperbolic cosine of the argument.
@@ -298,17 +297,17 @@
      * <li>{@code exp(-infinity) = +0.0}</li>
      * <li>{@code exp(NaN) = NaN}</li>
      * </ul>
-     *
+     * 
      * @param d
      *            the value whose exponential has to be computed.
      * @return the exponential of the argument.
      */
     public static native double exp(double d);
-    
+
     /**
-     * Returns the closest double approximation of <i>{@code e}</i><sup>
-     * {@code d}</sup>{@code - 1}. If the argument is very close to 0, it is
-     * much more accurate to use {@code expm1(d)+1} than {@code exp(d)} (due to
+     * Returns the closest double approximation of <i>{@code e}</i><sup>
{@code
+     * d}</sup>{@code - 1}. If the argument is very close to 0, it is much more
+     * accurate to use {@code expm1(d)+1} than {@code exp(d)} (due to
      * cancellation of significant digits). The returned result is within 1 ulp
      * (unit in the last place) of the real result.
      * <p>
@@ -323,12 +322,12 @@
      * <li>{@code expm1(-infinity) = -1.0}</li>
      * <li>{@code expm1(NaN) = NaN}</li>
      * </ul>
-     *
+     * 
      * @param d
-     *            the value to compute the <i>{@code e}</i><sup>{@code
d}
-     *            </sup>{@code - 1} of.
-     * @return the <i>{@code e}</i><sup>{@code d}</sup>{@code - 1}
value
-     *         of the argument.
+     *            the value to compute the <i>{@code e}</i><sup>{@code
d} </sup>
+     *            {@code - 1} of.
+     * @return the <i>{@code e}</i><sup>{@code d}</sup>{@code - 1}
value of the
+     *         argument.
      */
     public static native double expm1(double d);
 
@@ -344,25 +343,25 @@
      * <li>{@code floor(-infinity) = -infinity}</li>
      * <li>{@code floor(NaN) = NaN}</li>
      * </ul>
-     *
+     * 
      * @param d
      *            the value whose closest integer value has to be computed.
      * @return the floor of the argument.
      */
-	public static double floor(double d) {
-            if (Double.isNaN(d) || Double.isInfinite(d) || d == 0) {
-               return d; 
-            }  
-            double res = (double)(long)d;
-            return d > 0 || res == d ? res : res - 1; 
-        }
-    
-    /**
-     * Returns {@code sqrt(}<i>{@code x}</i><sup>{@code 2}</sup>{@code
+}
-     * <i> {@code y}</i><sup>{@code 2}</sup>{@code )}. The final
result is
-     * without medium underflow or overflow. The returned result is within 1 ulp
-     * (unit in the last place) of the real result. If one parameter remains
-     * constant, the result should be semi-monotonic.
+    public static double floor(double d) {
+        if (Double.isNaN(d) || Double.isInfinite(d) || d == 0) {
+            return d;
+        }
+        double res = (long) d;
+        return d > 0 || res == d ? res : res - 1;
+    }
+
+    /**
+     * Returns {@code sqrt(}<i>{@code x}</i><sup>{@code 2}</sup>{@code
+} <i>
+     * {@code y}</i><sup>{@code 2}</sup>{@code )}. The final result is
without
+     * medium underflow or overflow. The returned result is within 1 ulp (unit
+     * in the last place) of the real result. If one parameter remains constant,
+     * the result should be semi-monotonic.
      * <p>
      * Special cases:
      * <ul>
@@ -372,7 +371,7 @@
      * <li>{@code hypot((anything including NaN), -infinity) = +infinity}</li>
      * <li>{@code hypot(NaN, NaN) = NaN}</li>
      * </ul>
-     *
+     * 
      * @param x
      *            a double number.
      * @param y
@@ -401,7 +400,7 @@
      * <li>{@code IEEEremainder(x, -infinity) = x } where x is anything but
      * +/-infinity</li>
      * </ul>
-     *
+     * 
      * @param x
      *            the numerator of the operation.
      * @param y
@@ -424,7 +423,7 @@
      * <li>{@code log(-infinity) = NaN}</li>
      * <li>{@code log(NaN) = NaN}</li>
      * </ul>
-     *
+     * 
      * @param d
      *            the value whose log has to be computed.
      * @return the natural logarithm of the argument.
@@ -445,13 +444,13 @@
      * <li>{@code log10(-infinity) = NaN}</li>
      * <li>{@code log10(NaN) = NaN}</li>
      * </ul>
-     *
+     * 
      * @param d
      *            the value whose base 10 log has to be computed.
      * @return the natural logarithm of the argument.
      */
     public static native double log10(double d);
-    
+
     /**
      * Returns the closest double approximation of the natural logarithm of the
      * sum of the argument and 1. If the argument is very close to 0, it is much
@@ -469,7 +468,7 @@
      * <li>{@code log1p(-infinity) = NaN}</li>
      * <li>{@code log1p(NaN) = NaN}</li>
      * </ul>
-     *
+     * 
      * @param d
      *            the value to compute the {@code ln(1+d)} of.
      * @return the natural logarithm of the sum of the argument and 1.
@@ -487,27 +486,30 @@
      * <li>{@code max(+0.0, -0.0) = +0.0}</li>
      * <li>{@code max(-0.0, +0.0) = +0.0}</li>
      * </ul>
-     *
+     * 
      * @param d1
      *            the first argument.
      * @param d2
      *            the second argument.
      * @return the larger of {@code d1} and {@code d2}.
      */
-	public static double max(double d1, double d2) {
-		if (d1 > d2)
-			return d1;
-		if (d1 < d2)
-			return d2;
-		/* if either arg is NaN, return NaN */
-		if (d1 != d2)
-			return Double.NaN;
-		/* max(+0.0,-0.0) == +0.0 */
-	    if (Double.doubleToRawLongBits(d1) == Double.doubleToRawLongBits(-0.0d)) {
-	        return d2;
-	     }
-	     return 0.0d;
-	}
+    public static double max(double d1, double d2) {
+        if (d1 > d2) {
+            return d1;
+        }
+        if (d1 < d2) {
+            return d2;
+        }
+        /* if either arg is NaN, return NaN */
+        if (d1 != d2) {
+            return Double.NaN;
+        }
+        /* max(+0.0,-0.0) == +0.0 */
+        if (Double.doubleToRawLongBits(d1) == Double.doubleToRawLongBits(-0.0d)) {
+            return d2;
+        }
+        return 0.0d;
+    }
 
     /**
      * Returns the most positive (closest to positive infinity) of the two
@@ -520,55 +522,58 @@
      * <li>{@code max(+0.0, -0.0) = +0.0}</li>
      * <li>{@code max(-0.0, +0.0) = +0.0}</li>
      * </ul>
-     *
+     * 
      * @param f1
      *            the first argument.
      * @param f2
      *            the second argument.
      * @return the larger of {@code f1} and {@code f2}.
      */
-	public static float max(float f1, float f2) {
-		if (f1 > f2)
-			return f1;
-		if (f1 < f2)
-			return f2;
-		/* if either arg is NaN, return NaN */
-		if (f1 != f2)
-			return Float.NaN;
-		/* max(+0.0,-0.0) == +0.0 */
+    public static float max(float f1, float f2) {
+        if (f1 > f2) {
+            return f1;
+        }
+        if (f1 < f2) {
+            return f2;
+        }
+        /* if either arg is NaN, return NaN */
+        if (f1 != f2) {
+            return Float.NaN;
+        }
+        /* max(+0.0,-0.0) == +0.0 */
         if (Float.floatToRawIntBits(f1) == Float.floatToRawIntBits(-0.0f)) {
             return f2;
-         }
-         return 0.0f;
-	}
+        }
+        return 0.0f;
+    }
 
     /**
      * Returns the most positive (closest to positive infinity) of the two
      * arguments.
-     *
+     * 
      * @param i1
      *            the first argument.
      * @param i2
      *            the second argument.
      * @return the larger of {@code i1} and {@code i2}.
      */
-	public static int max(int i1, int i2) {
-		return i1 > i2 ? i1 : i2;
-	}
+    public static int max(int i1, int i2) {
+        return i1 > i2 ? i1 : i2;
+    }
 
     /**
      * Returns the most positive (closest to positive infinity) of the two
      * arguments.
-     *
+     * 
      * @param l1
      *            the first argument.
      * @param l2
      *            the second argument.
      * @return the larger of {@code l1} and {@code l2}.
      */
-	public static long max(long l1, long l2) {
-		return l1 > l2 ? l1 : l2;
-	}
+    public static long max(long l1, long l2) {
+        return l1 > l2 ? l1 : l2;
+    }
 
     /**
      * Returns the most negative (closest to negative infinity) of the two
@@ -581,27 +586,30 @@
      * <li>{@code min(+0.0, -0.0) = -0.0}</li>
      * <li>{@code min(-0.0, +0.0) = -0.0}</li>
      * </ul>
-     *
+     * 
      * @param d1
      *            the first argument.
      * @param d2
      *            the second argument.
      * @return the smaller of {@code d1} and {@code d2}.
      */
-	public static double min(double d1, double d2) {
-		if (d1 > d2)
-			return d2;
-		if (d1 < d2)
-			return d1;
-		/* if either arg is NaN, return NaN */
-		if (d1 != d2)
-			return Double.NaN;
-		/* min(+0.0,-0.0) == -0.0 */
+    public static double min(double d1, double d2) {
+        if (d1 > d2) {
+            return d2;
+        }
+        if (d1 < d2) {
+            return d1;
+        }
+        /* if either arg is NaN, return NaN */
+        if (d1 != d2) {
+            return Double.NaN;
+        }
+        /* min(+0.0,-0.0) == -0.0 */
         if (Double.doubleToRawLongBits(d1) == Double.doubleToRawLongBits(-0.0d)) {
             return -0.0d;
-         }
-         return d2;
-	}
+        }
+        return d2;
+    }
 
     /**
      * Returns the most negative (closest to negative infinity) of the two
@@ -614,59 +622,62 @@
      * <li>{@code min(+0.0, -0.0) = -0.0}</li>
      * <li>{@code min(-0.0, +0.0) = -0.0}</li>
      * </ul>
-     *
+     * 
      * @param f1
      *            the first argument.
      * @param f2
      *            the second argument.
      * @return the smaller of {@code f1} and {@code f2}.
      */
-	public static float min(float f1, float f2) {
-		if (f1 > f2)
-			return f2;
-		if (f1 < f2)
-			return f1;
-		/* if either arg is NaN, return NaN */
-		if (f1 != f2)
-			return Float.NaN;
-		/* min(+0.0,-0.0) == -0.0 */
+    public static float min(float f1, float f2) {
+        if (f1 > f2) {
+            return f2;
+        }
+        if (f1 < f2) {
+            return f1;
+        }
+        /* if either arg is NaN, return NaN */
+        if (f1 != f2) {
+            return Float.NaN;
+        }
+        /* min(+0.0,-0.0) == -0.0 */
         if (Float.floatToRawIntBits(f1) == Float.floatToRawIntBits(-0.0f)) {
             return -0.0f;
-         }
-         return f2;
-	}
+        }
+        return f2;
+    }
 
     /**
      * Returns the most negative (closest to negative infinity) of the two
      * arguments.
-     *
+     * 
      * @param i1
      *            the first argument.
      * @param i2
      *            the second argument.
      * @return the smaller of {@code i1} and {@code i2}.
      */
-	public static int min(int i1, int i2) {
-		return i1 < i2 ? i1 : i2;
-	}
+    public static int min(int i1, int i2) {
+        return i1 < i2 ? i1 : i2;
+    }
 
     /**
      * Returns the most negative (closest to negative infinity) of the two
      * arguments.
-     *
+     * 
      * @param l1
      *            the first argument.
      * @param l2
      *            the second argument.
      * @return the smaller of {@code l1} and {@code l2}.
      */
-	public static long min(long l1, long l2) {
-		return l1 < l2 ? l1 : l2;
-	}
+    public static long min(long l1, long l2) {
+        return l1 < l2 ? l1 : l2;
+    }
 
     /**
-     * Returns the closest double approximation of the result of raising
-     * {@code x} to the power of {@code y}.
+     * Returns the closest double approximation of the result of raising {@code
+     * x} to the power of {@code y}.
      * <p>
      * Special cases:
      * <ul>
@@ -690,11 +701,11 @@
      * <li>{@code pow(+infinity, (+anything except 0, NaN)) = +infinity}</li>
      * <li>{@code pow(+infinity, (-anything except 0, NaN)) = +0.0}</li>
      * <li>{@code pow(-infinity, (anything)) = -pow(0, (-anything))}</li>
-     * <li>{@code pow((-anything), (integer))} {@code =}
-     * {@code pow(-1,(integer))*pow(+anything,integer) }</li>
+     * <li>{@code pow((-anything), (integer))} {@code =} {@code
+     * pow(-1,(integer))*pow(+anything,integer) }</li>
      * <li>{@code pow((-anything except 0 and inf), (non-integer)) = NAN}</li>
      * </ul>
-     *
+     * 
      * @param x
      *            the base of the operation.
      * @param y
@@ -715,20 +726,20 @@
      * <li>{@code rint(-infinity) = -infinity}</li>
      * <li>{@code rint(NaN) = NaN}</li>
      * </ul>
-     *
+     * 
      * @param d
      *            the value to be rounded.
      * @return the closest integer to the argument (as a double).
      */
-	public static double rint(double d) {
-	    if(d == +0.0d || d == -0.0d) {
-	        return d;
-	    }
-            double res = floor(d + 0.5d);
-            return res - d == 0.5d && res%2 != 0 ? res - 1 : res;
+    public static double rint(double d) {
+        if (d == +0.0d || d == -0.0d) {
+            return d;
         }
+        double res = floor(d + 0.5d);
+        return res - d == 0.5d && res % 2 != 0 ? res - 1 : res;
+    }
 
-	/**
+    /**
      * Returns the result of rounding the argument to an integer. The result is
      * equivalent to {@code (long) Math.floor(d+0.5)}.
      * <p>
@@ -742,17 +753,18 @@
      * <li>{@code round(-infintiy) = Long.MIN_VALUE}</li>
      * <li>{@code round(NaN) = +0.0}</li>
      * </ul>
-     *
+     * 
      * @param d
      *            the value to be rounded.
      * @return the closest integer to the argument.
      */
-	public static long round(double d) {
-		// check for NaN
-		if (d != d)
-			return 0L;
-		return (long) floor(d + 0.5d);
-	}
+    public static long round(double d) {
+        // check for NaN
+        if (d != d) {
+            return 0L;
+        }
+        return (long) floor(d + 0.5d);
+    }
 
     /**
      * Returns the result of rounding the argument to an integer. The result is
@@ -768,18 +780,19 @@
      * <li>{@code round(-infintiy) = Integer.MIN_VALUE}</li>
      * <li>{@code round(NaN) = +0.0}</li>
      * </ul>
-     *
+     * 
      * @param f
      *            the value to be rounded.
      * @return the closest integer to the argument.
      */
-	public static int round(float f) {
-		// check for NaN
-		if (f != f)
-			return 0;
-		return (int) floor(f + 0.5f);
-	}
-    
+    public static int round(float f) {
+        // check for NaN
+        if (f != f) {
+            return 0;
+        }
+        return (int) floor(f + 0.5f);
+    }
+
     /**
      * Returns the signum function of the argument. If the argument is less than
      * zero, it returns -1.0. If the argument is greater than zero, 1.0 is
@@ -794,7 +807,7 @@
      * <li>{@code signum(-infinity) = -1.0}</li>
      * <li>{@code signum(NaN) = NaN}</li>
      * </ul>
-     *
+     * 
      * @param d
      *            the value whose signum has to be computed.
      * @return the value of the signum function.
@@ -802,7 +815,7 @@
     public static double signum(double d) {
         return StrictMath.signum(d);
     }
-    
+
     /**
      * Returns the signum function of the argument. If the argument is less than
      * zero, it returns -1.0. If the argument is greater than zero, 1.0 is
@@ -817,7 +830,7 @@
      * <li>{@code signum(-infinity) = -1.0}</li>
      * <li>{@code signum(NaN) = NaN}</li>
      * </ul>
-     *
+     * 
      * @param f
      *            the value whose signum has to be computed.
      * @return the value of the signum function.
@@ -839,13 +852,13 @@
      * <li>{@code sin(-infinity) = NaN}</li>
      * <li>{@code sin(NaN) = NaN}</li>
      * </ul>
-     *
+     * 
      * @param d
      *            the angle whose sin has to be computed, in radians.
      * @return the sine of the argument.
      */
     public static native double sin(double d);
-    
+
     /**
      * Returns the closest double approximation of the hyperbolic sine of the
      * argument. The returned result is within 2.5 ulps (units in the last
@@ -859,7 +872,7 @@
      * <li>{@code sinh(-infinity) = -infinity}</li>
      * <li>{@code sinh(NaN) = NaN}</li>
      * </ul>
-     *
+     * 
      * @param d
      *            the value whose hyperbolic sine has to be computed.
      * @return the hyperbolic sine of the argument.
@@ -878,7 +891,7 @@
      * <li>{@code sqrt(+infinity) = +infinity}</li>
      * <li>{@code sqrt(NaN) = NaN}</li>
      * </ul>
-     *
+     * 
      * @param d
      *            the value whose square root has to be computed.
      * @return the square root of the argument.
@@ -898,13 +911,13 @@
      * <li>{@code tan(-infinity) = NaN}</li>
      * <li>{@code tan(NaN) = NaN}</li>
      * </ul>
-     *
+     * 
      * @param d
      *            the angle whose tangens has to be computed, in radians.
      * @return the tangent of the argument.
      */
     public static native double tan(double d);
-    
+
     /**
      * Returns the closest double approximation of the hyperbolic tangent of the
      * argument. The absolute value is always less than 1. The returned result
@@ -920,7 +933,7 @@
      * <li>{@code tanh(-infinity) = -1.0}</li>
      * <li>{@code tanh(NaN) = NaN}</li>
      * </ul>
-     *
+     * 
      * @param d
      *            the value whose hyperbolic tangent has to be computed.
      * @return the hyperbolic tangent of the argument.
@@ -930,15 +943,15 @@
     /**
      * Returns a pseudo-random number between 0.0 (inclusive) and 1.0
      * (exclusive).
-     *
+     * 
      * @return a pseudo-random number.
      */
-	public static double random() {
-		if (random == null) {
-			random = new java.util.Random();
-		}
-		return random.nextDouble();
-	}
+    public static double random() {
+        if (random == null) {
+            random = new java.util.Random();
+        }
+        return random.nextDouble();
+    }
 
     /**
      * Returns the measure in radians of the supplied degree angle. The result
@@ -952,14 +965,14 @@
      * <li>{@code toRadians(-infinity) = -infinity}</li>
      * <li>{@code toRadians(NaN) = NaN}</li>
      * </ul>
-     *
+     * 
      * @param angdeg
      *            an angle in degrees.
      * @return the radian measure of the angle.
      */
-	public static double toRadians(double angdeg) {
-		return angdeg / 180d * PI;
-	}
+    public static double toRadians(double angdeg) {
+        return angdeg / 180d * PI;
+    }
 
     /**
      * Returns the measure in degrees of the supplied radian angle. The result
@@ -973,20 +986,20 @@
      * <li>{@code toDegrees(-infinity) = -infinity}</li>
      * <li>{@code toDegrees(NaN) = NaN}</li>
      * </ul>
-     *
+     * 
      * @param angrad
      *            an angle in radians.
      * @return the degree measure of the angle.
      */
-	public static double toDegrees(double angrad) {
-		return angrad * 180d / PI;
-	}
-	
-	/**
+    public static double toDegrees(double angrad) {
+        return angrad * 180d / PI;
+    }
+
+    /**
      * Returns the argument's ulp (unit in the last place). The size of a ulp of
      * a double value is the positive distance between this value and the double
-     * value next larger in magnitude. For non-NaN {@code x},
-     * {@code ulp(-x) == ulp(x)}.
+     * value next larger in magnitude. For non-NaN {@code x}, {@code ulp(-x) ==
+     * ulp(x)}.
      * <p>
      * Special cases:
      * <ul>
@@ -996,7 +1009,7 @@
      * <li>{@code ulp(-infintiy) = infinity}</li>
      * <li>{@code ulp(NaN) = NaN}</li>
      * </ul>
-     *
+     * 
      * @param d
      *            the floating-point value to compute ulp of.
      * @return the size of a ulp of the argument.
@@ -1015,8 +1028,8 @@
     /**
      * Returns the argument's ulp (unit in the last place). The size of a ulp of
      * a float value is the positive distance between this value and the float
-     * value next larger in magnitude. For non-NaN {@code x},
-     * {@code ulp(-x) == ulp(x)}.
+     * value next larger in magnitude. For non-NaN {@code x}, {@code ulp(-x) ==
+     * ulp(x)}.
      * <p>
      * Special cases:
      * <ul>
@@ -1026,7 +1039,7 @@
      * <li>{@code ulp(-infintiy) = infinity}</li>
      * <li>{@code ulp(NaN) = NaN}</li>
      * </ul>
-     *
+     * 
      * @param f
      *            the floating-point value to compute ulp of.
      * @return the size of a ulp of the argument.
@@ -1046,5 +1059,5 @@
 
     private native static double nextafter(double x, double y);
 
-    private native static float nextafterf(float x, float y); 
+    private native static float nextafterf(float x, float y);
 }



Mime
View raw message