You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ah...@apache.org on 2019/12/12 12:37:16 UTC
[commons-numbers] branch master updated: Improved javadoc for
public constants.
This is an automated email from the ASF dual-hosted git repository.
aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-numbers.git
The following commit(s) were added to refs/heads/master by this push:
new 20a5c8f Improved javadoc for public constants.
20a5c8f is described below
commit 20a5c8f9e9d7f294ef343c1a7603d366082c4913
Author: aherbert <ah...@apache.org>
AuthorDate: Thu Dec 12 12:37:12 2019 +0000
Improved javadoc for public constants.
This includes the formal (a + i b) notation to make it clear what the
number represents.
---
.../org/apache/commons/numbers/complex/Complex.java | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/commons-numbers-complex/src/main/java/org/apache/commons/numbers/complex/Complex.java b/commons-numbers-complex/src/main/java/org/apache/commons/numbers/complex/Complex.java
index e1afc49..1677102 100644
--- a/commons-numbers-complex/src/main/java/org/apache/commons/numbers/complex/Complex.java
+++ b/commons-numbers-complex/src/main/java/org/apache/commons/numbers/complex/Complex.java
@@ -47,13 +47,23 @@ import org.apache.commons.numbers.core.Precision;
* ISO/IEC 9899 - Programming languages - C</a>
*/
public final class Complex implements Serializable {
- /** The square root of -1, a.k.a. "i". */
+ /**
+ * A complex number representing {@code i}, the square root of -1.
+ * <pre>{@code 0 + i 1}</pre>
+ */
public static final Complex I = new Complex(0, 1);
- /** A complex number representing one. */
+ /**
+ * A complex number representing one.
+ * <pre>{@code 1 + i 0}</pre>
+ */
public static final Complex ONE = new Complex(1, 0);
- /** A complex number representing zero. */
+ /**
+ * A complex number representing zero.
+ * <pre>{@code 0 + i 0}</pre>
+ */
public static final Complex ZERO = new Complex(0, 0);
- /** A complex number representing "NaN + NaN i". */
+
+ /** A complex number representing "NaN + NaN i": {@code NaN + i NaN} */
private static final Complex NAN = new Complex(Double.NaN, Double.NaN);
/** 3*π/4. */
private static final double PI_3_OVER_4 = 0.75 * Math.PI;