sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1394921 - in /sis/trunk: ./ sis-utility/src/main/java/org/apache/sis/math/ sis-utility/src/main/java/org/apache/sis/util/resources/ sis-utility/src/test/java/org/apache/sis/util/type/
Date Sat, 06 Oct 2012 04:47:08 GMT
Author: desruisseaux
Date: Sat Oct  6 04:47:08 2012
New Revision: 1394921

URL: http://svn.apache.org/viewvc?rev=1394921&view=rev
Log:
Merge from the JDK6 branch.

Modified:
    sis/trunk/   (props changed)
    sis/trunk/sis-utility/src/main/java/org/apache/sis/math/MathFunctions.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/math/package-info.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/ResourceInternationalString.java
    sis/trunk/sis-utility/src/test/java/org/apache/sis/util/type/TypesTest.java

Propchange: sis/trunk/
------------------------------------------------------------------------------
  Merged /sis/branches/JDK7:r1394913-1394919
  Merged /sis/branches/JDK6:r1394900-1394920

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/math/MathFunctions.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/math/MathFunctions.java?rev=1394921&r1=1394920&r2=1394921&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/math/MathFunctions.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/math/MathFunctions.java Sat Oct  6
04:47:08 2012
@@ -38,15 +38,22 @@ import static org.apache.sis.util.Arrays
  * However the methods in this class put an emphasis on:
  * <p>
  * <ul>
- *   <li>Rounding errors: {@link #magnitude(double[])}, {@link #pow10(double)}.</li>
- *   <li>Distinguishing positive zero from negative zero: {@link #isPositive(double)},
- *       {@link #isNegative(double)}, {@link #isSameSign(double, double)},
- *       {@link #xorSign(double, double)}.</li>
- *   <li>Distinguishing the different kinds of NaN numbers: {@link #toNanFloat(int)},
- *       {@link #toNanOrdinal(float)}.</li>
+ *   <li>Rounding errors:
+ *       {@link #magnitude(double[]) magnitude},
+ *       {@link #pow10(double) pow10}.</li>
+ *   <li>Distinguishing positive zero from negative zero:
+ *       {@link #isPositive(double) isPositive},
+ *       {@link #isNegative(double) isNegative},
+ *       {@link #isSameSign(double, double) isSameSign},
+ *       {@link #xorSign(double, double) xorSign}.</li>
+ *   <li>Distinguishing the different kinds of NaN numbers:
+ *       {@link #toNanFloat(int) toNanFloat},
+ *       {@link #toNanOrdinal(float) toNanOrdinal}.</li>
  * </ul>
  * <p>
- * Additional functions not found in {@code Math} are: {@link #atanh(double)}.
+ * Some additional functions not found in {@code Math} are:
+ * {@link #atanh(double) atanh},
+ * {@link #nextPrimeNumber(int) nextPrimeNumber}.
  *
  * @author  Martin Desruisseaux (MPO, IRD, Geomatys)
  * @since   0.3 (derived from geotk-1.0)
@@ -217,13 +224,14 @@ public final class MathFunctions extends
 
     /**
      * Computes 10 raised to the power of <var>x</var>. This method tries to
be slightly more
-     * accurate than <code>{@linkplain Math#pow(double, double) Math.pow}(10,x)</code>,
+     * accurate than <code>{@linkplain Math#pow(double, double) Math.pow}(10, x)</code>,
      * sometime at the cost of performance.
-     * <p>
-     * The {@code Math.pow(10,x)} method doesn't always return the closest IEEE floating
point
-     * representation. More accurate calculations are slower and usually not necessary, but
the
-     * base 10 is a special case since it is used for scaling axes or formatting human-readable
-     * output, in which case the precision may matter.
+     *
+     * {@note This method has been defined because the standard <code>Math.pow(10,
x)</code>
+     * method does not always return the closest IEEE floating point representation. Slight
+     * departures (1 or 2 ULP) are often allowed in math functions for performance reasons.
+     * The most accurate calculations are usually not necessary, but the base 10 is a special
+     * case since it is used for scaling axes or formatting human-readable output.}
      *
      * @param x The exponent.
      * @return 10 raised to the given exponent.
@@ -258,7 +266,7 @@ public final class MathFunctions extends
      * The range of input values shall be in the [-1 … 1].
      * <p>
      * Special cases:
-     * </ul>
+     * <ul>
      *   <li>For <var>x</var> = NaN, this method returns a {@linkplain
Double#isNaN(double) NaN} value.</li>
      *   <li>For <var>x</var> = -1, this method returns {@linkplain Double#NEGATIVE_INFINITY
negative infinity}.</li>
      *   <li>For <var>x</var> = +1, this method returns {@linkplain Double#POSITIVE_INFINITY
positive infinity}.</li>
@@ -458,7 +466,7 @@ public final class MathFunctions extends
     /**
      * Returns a {@linkplain Float#isNaN(float) NaN} number for the specified ordinal value.
      * Valid NaN numbers in Java can have bit fields in the ranges listed below.
-     * This method allocate one of valid NaN bit fields to each ordinal value.
+     * This method allocates one of valid NaN bit fields to each ordinal value.
      * <p>
      * <ul>
      *   <li>[{@code 0x7F800001} … {@code 0x7FFFFFFF}], with
@@ -469,7 +477,6 @@ public final class MathFunctions extends
      * The relationship between bit fields and ordinal values is implementation dependent
and may
      * change in any future version of the SIS library. The current implementation restricts
the
      * range of allowed ordinal values to a smaller one than the range of all possible NaN
values.
-     * However we
      *
      * @param  ordinal The NaN ordinal value, from {@code -0x200000} to {@code 0x1FFFFF}
inclusive.
      * @return One of the legal {@linkplain Float#isNaN(float) NaN} values as a float.

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/math/package-info.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/math/package-info.java?rev=1394921&r1=1394920&r2=1394921&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/math/package-info.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/math/package-info.java Sat Oct  6 04:47:08
2012
@@ -18,12 +18,6 @@
 /**
  * A set of mathematical objects and algebraic utilities.
  *
- * {@section References:}
- * <ul>
- *   <li><a href="http://mathworld.wolfram.com/">Eric Weisstein's World of Mathematic</a></li>
- *   <li><a href="http://www.worldserver.com/turk/opensource/">Ken Turkiwski's
Open Source Repository</a></li>
- * </ul>
- *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from geotk-2.0)
  * @version 0.3

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/ResourceInternationalString.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/ResourceInternationalString.java?rev=1394921&r1=1394920&r2=1394921&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/ResourceInternationalString.java
(original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/resources/ResourceInternationalString.java
Sat Oct  6 04:47:08 2012
@@ -20,10 +20,10 @@ import java.io.Serializable;
 import java.util.Locale;
 import java.util.MissingResourceException;
 import net.jcip.annotations.Immutable;
+import org.apache.sis.util.Utilities;
 import org.apache.sis.util.type.AbstractInternationalString;
 
 // Related to JDK7
-import org.apache.sis.util.Utilities;
 import org.apache.sis.internal.util.Objects;
 
 

Modified: sis/trunk/sis-utility/src/test/java/org/apache/sis/util/type/TypesTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/test/java/org/apache/sis/util/type/TypesTest.java?rev=1394921&r1=1394920&r2=1394921&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/test/java/org/apache/sis/util/type/TypesTest.java (original)
+++ sis/trunk/sis-utility/src/test/java/org/apache/sis/util/type/TypesTest.java Sat Oct  6
04:47:08 2012
@@ -20,7 +20,6 @@ import org.opengis.metadata.citation.Cit
 import org.opengis.referencing.datum.Datum;
 import org.opengis.referencing.cs.AxisDirection;
 import org.apache.sis.test.TestCase;
-import org.junit.Ignore;
 import org.junit.Test;
 
 import static org.junit.Assert.*;



Mime
View raw message