From 4e076a65eead3781821a80d2b8ca7e025fe3b789 Mon Sep 17 00:00:00 2001 From: Bernd Busse Date: Thu, 27 Jul 2023 21:44:07 +0200 Subject: [PATCH] classlib: add BigInteger constant TWO added in Java 9 --- .../java/org/teavm/classlib/java/math/TBigInteger.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/classlib/src/main/java/org/teavm/classlib/java/math/TBigInteger.java b/classlib/src/main/java/org/teavm/classlib/java/math/TBigInteger.java index 99e676e06..9ceaabf4b 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/math/TBigInteger.java +++ b/classlib/src/main/java/org/teavm/classlib/java/math/TBigInteger.java @@ -67,6 +67,11 @@ public class TBigInteger extends Number implements Comparable, Seri */ public static final TBigInteger ONE = new TBigInteger(1, 1); + /** + * The {@code BigInteger} constant 2. + */ + public static final TBigInteger TWO = new TBigInteger(1, 2); + /** * The {@code BigInteger} constant 10. */ @@ -85,7 +90,7 @@ public class TBigInteger extends Number implements Comparable, Seri static final int LESS = -1; /** All the {@code BigInteger} numbers in the range [0,10] are cached. */ - static final TBigInteger[] SMALL_VALUES = { ZERO, ONE, new TBigInteger(1, 2), new TBigInteger(1, 3), + static final TBigInteger[] SMALL_VALUES = { ZERO, ONE, TWO, new TBigInteger(1, 3), new TBigInteger(1, 4), new TBigInteger(1, 5), new TBigInteger(1, 6), new TBigInteger(1, 7), new TBigInteger(1, 8), new TBigInteger(1, 9), TEN };