# Calculate pow(int n) with BigDecimal number in different method

I'm trying to use BigDecimal function pow(int n), and it works fine for me. However, when I enter large numbers it takes more time to calculate which is not good for my algorithm. Is there a faster way to calculate power of numbers and returns exactly, to unlimited precision? Below is an example of my case:

private static BigDecimal decryption(BigDecimal cipherTxt, int dVal){

return cipherTxt.pow(dVal);

}

When I enter:

cipherTxt = 11395128

dVal = 19299953

11395128.pow(19299953)

It takes more time, and it is not useful for my program....

By: StackOverFlow - 6 days ago

# Related Posts

- Older News
- Ordering an ArrayList
with bubble sort StackOverFlow (2 days ago) - I'm trying to order an Arraylist which contains BigDecimal value of money from the largest to the smallest.That's my code:public void bubble_sort(ArrayList nameArray, ArrayList priceArray){for (int i = 0; i... - How to use concurrency of a series problem in java? StackOverFlow (2 days ago) - Observe the Series.java and SeriesSolver.java classes that havebeen provided. The Series class represents a series as characterizedby an equation for the nth element (using the Java BigDecimalclass). The SeriesSolver.java class...