From 925cc2854b4b301a37f4e034f80da8cc7281c77f Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 21 Sep 2005 17:00:30 +0000 Subject: * 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. --- java/math/BigDecimal.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'java/math/BigDecimal.java') diff --git a/java/math/BigDecimal.java b/java/math/BigDecimal.java index d99be0f56..693c39987 100644 --- a/java/math/BigDecimal.java +++ b/java/math/BigDecimal.java @@ -43,12 +43,27 @@ public class BigDecimal extends Number implements Comparable private int scale; private static final long serialVersionUID = 6108874887143696463L; - private static final BigDecimal ZERO = + /** + * The constant zero as a BigDecimal with scale zero. + * @since 1.5 + */ + public static final BigDecimal ZERO = new BigDecimal (BigInteger.valueOf (0), 0); - private static final BigDecimal ONE = + /** + * The constant one as a BigDecimal with scale zero. + * @since 1.5 + */ + public static final BigDecimal ONE = new BigDecimal (BigInteger.valueOf (1), 0); + /** + * The constant ten as a BigDecimal with scale zero. + * @since 1.5 + */ + public static final BigDecimal TEN = + new BigDecimal (BigInteger.valueOf (10), 0); + public static final int ROUND_UP = 0; public static final int ROUND_DOWN = 1; public static final int ROUND_CEILING = 2; -- cgit v1.2.1