summaryrefslogtreecommitdiff
path: root/java/math/BigInteger.java
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2005-09-21 17:00:30 +0000
committerTom Tromey <tromey@redhat.com>2005-09-21 17:00:30 +0000
commit925cc2854b4b301a37f4e034f80da8cc7281c77f (patch)
treea6d39ba4a1d40f9d606d0be40bb7fec98bf094bb /java/math/BigInteger.java
parentd72cadfe11c557bfb27a9a3ac3549304e77816b4 (diff)
downloadclasspath-925cc2854b4b301a37f4e034f80da8cc7281c77f.tar.gz
* java/math/BigDecimal.java (ZERO, ONE): Now public. Updated
javadoc. (TEN): New constant. * java/math/BigInteger.java (ZERO): Updated javadoc. (ONE): Likewise. (TEN): New constant.
Diffstat (limited to 'java/math/BigInteger.java')
-rw-r--r--java/math/BigInteger.java19
1 files changed, 16 insertions, 3 deletions
diff --git a/java/math/BigInteger.java b/java/math/BigInteger.java
index 82f550d14..5a336b872 100644
--- a/java/math/BigInteger.java
+++ b/java/math/BigInteger.java
@@ -76,7 +76,8 @@ public class BigInteger extends Number implements Comparable
private static final long serialVersionUID = -8287574255936472291L;
- /** We pre-allocate integers in the range minFixNum..maxFixNum. */
+ /** We pre-allocate integers in the range minFixNum..maxFixNum.
+ * Note that we must at least preallocate 0, 1, and 10. */
private static final int minFixNum = -100;
private static final int maxFixNum = 1024;
private static final int numFixNum = maxFixNum-minFixNum+1;
@@ -87,11 +88,23 @@ public class BigInteger extends Number implements Comparable
smallFixNums[i] = new BigInteger(i + minFixNum);
}
- // JDK1.2
+ /**
+ * The constant zero as a BigInteger.
+ * @since 1.2
+ */
public static final BigInteger ZERO = smallFixNums[-minFixNum];
- // JDK1.2
+ /**
+ * The constant one as a BigInteger.
+ * @since 1.2
+ */
public static final BigInteger ONE = smallFixNums[1 - minFixNum];
+
+ /**
+ * The constant ten as a BigInteger.
+ * @since 1.5
+ */
+ public static final BigInteger TEN = smallFixNums[10 - minFixNum];
/* Rounding modes: */
private static final int FLOOR = 1;