You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ra...@apache.org on 2017/05/13 14:41:09 UTC
[06/15] [math] Fix javadoc issues
Fix javadoc issues
Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/55a6aa82
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/55a6aa82
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/55a6aa82
Branch: refs/heads/master
Commit: 55a6aa82d1abd90b83f8fd163c062e3832d598de
Parents: 2fac0dc
Author: Ray DeCampo <ra...@decampo.org>
Authored: Sat May 13 09:42:41 2017 -0400
Committer: Ray DeCampo <ra...@decampo.org>
Committed: Sat May 13 09:42:41 2017 -0400
----------------------------------------------------------------------
.../java/org/apache/commons/math4/dfp/Dfp.java | 4 +-
.../org/apache/commons/math4/dfp/DfpField.java | 2 +
.../org/apache/commons/math4/dfp/DfpMath.java | 55 +++++++++++---------
3 files changed, 33 insertions(+), 28 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-math/blob/55a6aa82/src/main/java/org/apache/commons/math4/dfp/Dfp.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/dfp/Dfp.java b/src/main/java/org/apache/commons/math4/dfp/Dfp.java
index 22f2868..08d29d0 100644
--- a/src/main/java/org/apache/commons/math4/dfp/Dfp.java
+++ b/src/main/java/org/apache/commons/math4/dfp/Dfp.java
@@ -51,9 +51,9 @@ import org.apache.commons.math4.util.FastMath;
* </ol>
*
* <p>Numbers are represented in the following form:
- * <pre>
+ * <div style="white-space: pre"><code>
* n = sign × mant × (radix)<sup>exp</sup>;
- * </pre>
+ * </code></div>
* where sign is ±1, mantissa represents a fractional number between
* zero and one. mant[0] is the least significant digit.
* exp is in the range of -32767 to 32768
http://git-wip-us.apache.org/repos/asf/commons-math/blob/55a6aa82/src/main/java/org/apache/commons/math4/dfp/DfpField.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/dfp/DfpField.java b/src/main/java/org/apache/commons/math4/dfp/DfpField.java
index c83051d..c96c363 100644
--- a/src/main/java/org/apache/commons/math4/dfp/DfpField.java
+++ b/src/main/java/org/apache/commons/math4/dfp/DfpField.java
@@ -676,6 +676,7 @@ public class DfpField implements Field<Dfp> {
/** Compute ln(a).
*
+ * <pre>{@code
* Let f(x) = ln(x),
*
* We know that f'(x) = 1/x, thus from Taylor's theorem we have:
@@ -727,6 +728,7 @@ public class DfpField implements Field<Dfp> {
* But now we want to find ln(a), so we need to find the value of x
* such that a = (x+1)/(x-1). This is easily solved to find that
* x = (a-1)/(a+1).
+ * }</pre>
* @param a number for which we want the exponential
* @param one constant with value 1 at desired precision
* @param two constant with value 2 at desired precision
http://git-wip-us.apache.org/repos/asf/commons-math/blob/55a6aa82/src/main/java/org/apache/commons/math4/dfp/DfpMath.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/dfp/DfpMath.java b/src/main/java/org/apache/commons/math4/dfp/DfpMath.java
index c66ae2d..734c8fa 100644
--- a/src/main/java/org/apache/commons/math4/dfp/DfpMath.java
+++ b/src/main/java/org/apache/commons/math4/dfp/DfpMath.java
@@ -283,7 +283,8 @@ public class DfpMath {
}
/** Computes e to the given power.
- * Where -1 < a < 1. Use the classic Taylor series. 1 + x**2/2! + x**3/3! + x**4/4! ...
+ * Where {@code -1 < a < 1}. Use the classic Taylor series.
+ * {@code 1 + x**2/2! + x**3/3! + x**4/4! ... }
* @param a power at which e should be raised
* @return e<sup>a</sup>
*/
@@ -307,9 +308,9 @@ public class DfpMath {
}
/** Returns the natural logarithm of a.
- * a is first split into three parts such that a = (10000^h)(2^j)k.
- * ln(a) is computed by ln(a) = ln(5)*h + ln(2)*(h+j) + ln(k)
- * k is in the range 2/3 < k <4/3 and is passed on to a series expansion.
+ * a is first split into three parts such that {@code a = (10000^h)(2^j)k}.
+ * ln(a) is computed by {@code ln(a) = ln(5)*h + ln(2)*(h+j) + ln(k)}.
+ * k is in the range {@code 2/3 < k <4/3} and is passed on to a series expansion.
* @param a number from which logarithm is requested
* @return log(a)
*/
@@ -377,6 +378,7 @@ public class DfpMath {
}
/** Computes the natural log of a number between 0 and 2.
+ * <pre>{@code
* Let f(x) = ln(x),
*
* We know that f'(x) = 1/x, thus from Taylor's theorum we have:
@@ -428,6 +430,7 @@ public class DfpMath {
* But now we want to find ln(a), so we need to find the value of x
* such that a = (x+1)/(x-1). This is easily solved to find that
* x = (a-1)/(a+1).
+ * }</pre>
* @param a number from which logarithm is requested, in split form
* @return log(a)
*/
@@ -463,7 +466,7 @@ public class DfpMath {
/** Computes x to the y power.<p>
*
- * Uses the following method:<p>
+ * Uses the following method:
*
* <ol>
* <li> Set u = rint(y), v = y-u
@@ -472,30 +475,30 @@ public class DfpMath {
* <li> Compute c = a - b*ln(2)
* <li> x<sup>y</sup> = x<sup>u</sup> * 2<sup>b</sup> * e<sup>c</sup>
* </ol>
- * if |y| > 1e8, then we compute by exp(y*ln(x)) <p>
+ * if {@code |y| > 1e8}, then we compute by {@code exp(y*ln(x))}<p>
*
- * <b>Special Cases</b><p>
+ * <b>Special Cases</b>
* <ul>
* <li> if y is 0.0 or -0.0 then result is 1.0
* <li> if y is 1.0 then result is x
* <li> if y is NaN then result is NaN
* <li> if x is NaN and y is not zero then result is NaN
- * <li> if |x| > 1.0 and y is +Infinity then result is +Infinity
- * <li> if |x| < 1.0 and y is -Infinity then result is +Infinity
- * <li> if |x| > 1.0 and y is -Infinity then result is +0
- * <li> if |x| < 1.0 and y is +Infinity then result is +0
- * <li> if |x| = 1.0 and y is +/-Infinity then result is NaN
- * <li> if x = +0 and y > 0 then result is +0
- * <li> if x = +Inf and y < 0 then result is +0
- * <li> if x = +0 and y < 0 then result is +Inf
- * <li> if x = +Inf and y > 0 then result is +Inf
- * <li> if x = -0 and y > 0, finite, not odd integer then result is +0
- * <li> if x = -0 and y < 0, finite, and odd integer then result is -Inf
- * <li> if x = -Inf and y > 0, finite, and odd integer then result is -Inf
- * <li> if x = -0 and y < 0, not finite odd integer then result is +Inf
- * <li> if x = -Inf and y > 0, not finite odd integer then result is +Inf
- * <li> if x < 0 and y > 0, finite, and odd integer then result is -(|x|<sup>y</sup>)
- * <li> if x < 0 and y > 0, finite, and not integer then result is NaN
+ * <li> if {@code |x| > 1.0} and y is +Infinity then result is +Infinity
+ * <li> if {@code |x| < 1.0} and y is -Infinity then result is +Infinity
+ * <li> if {@code |x| > 1.0} and y is -Infinity then result is +0
+ * <li> if {@code |x| < 1.0} and y is +Infinity then result is +0
+ * <li> if {@code |x| = 1.0} and y is +/-Infinity then result is NaN
+ * <li> if {@code x = +0} and {@code y > 0} then result is +0
+ * <li> if {@code x = +Inf} and {@code y < 0} then result is +0
+ * <li> if {@code x = +0} and {@code y < 0} then result is +Inf
+ * <li> if {@code x = +Inf} and {@code y > 0} then result is +Inf
+ * <li> if {@code x = -0} and {@code y > 0}, finite, not odd integer then result is +0
+ * <li> if {@code x = -0} and {@code y < 0}, finite, and odd integer then result is -Inf
+ * <li> if {@code x = -Inf} and {@code y > 0}, finite, and odd integer then result is -Inf
+ * <li> if {@code x = -0} and {@code y < 0}, not finite odd integer then result is +Inf
+ * <li> if {@code x = -Inf} and {@code y > 0}, not finite odd integer then result is +Inf
+ * <li> if {@code x < 0} and {@code y > 0}, finite, and odd integer then result is -(|x|<sup>y</sup>)
+ * <li> if {@code x < 0} and {@code y > 0}, finite, and not integer then result is NaN
* </ul>
* @param x base to be raised
* @param y power to which base should be raised
@@ -661,8 +664,8 @@ public class DfpMath {
}
- /** Computes sin(a) Used when 0 < a < pi/4.
- * Uses the classic Taylor series. x - x**3/3! + x**5/5! ...
+ /** Computes sin(a) Used when {@code {@code 0 < a < pi/4}}.
+ * Uses the classic Taylor series. {@code x - x**3/3! + x**5/5! ... }
* @param a number from which sine is desired, in split form
* @return sin(a)
*/
@@ -691,7 +694,7 @@ public class DfpMath {
}
- /** Computes cos(a) Used when 0 < a < pi/4.
+ /** Computes cos(a) Used when {@code 0 < a < pi/4}.
* Uses the classic Taylor series for cosine. 1 - x**2/2! + x**4/4! ...
* @param a number from which cosine is desired, in split form
* @return cos(a)