wrote:
> Hi,
>
> I have a problem with calculating expression, in which I have to use
>
> BigDecimal1 ^ BigDecimal2
>
>
> BigDecimal.pow() isn't suitable - as far as I know, it requires int as
> an parameter, and both my numbers are BigDecimals.
>
>
> Does anyone know how to handle it?
bd1.pow(bd2.intValue()) looks like a good starting point.
If bd2 has a fractional part, you'll need to work harder --
perhaps Math.pow(bd1.doubleValue(), bd2.doubleValue()) would
be of use, followed by conversion from double to BigDecimal.
Seems like a strange thing to want to do, though. I hope
you've got lots of memory ...
--
Eric Sosman
lid