commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henri Yandell <bay...@generationjava.com>
Subject Re: [lang] what about mutable BigInteger etc.
Date Mon, 23 Dec 2002 19:04:31 GMT

MutableBigInteger does exist in JDK 1.3 in java.math, but is hidden. It'd
be worth checking that the API of the submitted version matches the API of
the hidden one, in case Sun ever made that public.

Hen

On Mon, 23 Dec 2002, Stephen Colebourne wrote:

> Immutable classes have various advantages over mutable ones, not least being
> thread-safe.
>
> However, I would not be averse to adding mutable versions of the Number
> classes to math. I would want to see the complete set however,
> MutableBigDecimal, MutableBigInteger, MutableInteger, MutableLong,
> MutableDouble, MutableFloat and MutableFraction. They would need to be
> Number subclasses.
>
> Have you got code already? (I prefer immutable, so I don't especially want
> to write the mutable classes.)
>
> Stephen
>
> ----- Original Message -----
> From: <victor.volle@gmxpro.net>
> > What do you think about implementing mutable
> > BigInteger and BigDecimal classes as part of a [math]
> > package?
> >
> > Using BigDecimal for financial applications comes with
> > a big drawback: for every calculation a new BigDecimal
> > object is created since BigDecimals are immutable.
> > You might even need to create two BigDecimal per
> > calculation:
> >
> >     BigDecimal result = ...
> >     result = result.plus(new BigDecimal(0.345f));
> >
> > Or is there some other library you know of?
> >
> > Victor
> >
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:commons-dev-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> <mailto:commons-dev-help@jakarta.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message