Cody

# Problem 1833. Usage of java.math : Add, Multiply, Pow

This challenge is an introduction to the wonderful word of java.math that allows unlimited precision calculations. The primary reference sites are Java Math, Java BigDecimal, and Java BigInteger.

The usage of BigDecimal functions add, multiply, and pow will be tested.

Java Math tutorial: (Simplified summary that is believed correct)

```vd-decimal value, vstr-string, vi-integer value
xBD=java.math.BigDecimal(vd);  % valid vd,vstr,vi creates xBD a BigDecimal variable
import java.math.*;  % simplifies statements
xBD=BigDecimal(vstr);
x2pwrBD=xBD.pow(vi); % Invalid: vd,vstr,BD
xmultiplyzBD=xBD.multiply(BigDecimal(z));  % multiply input requires BD type
```
```To convert java to string of unlimited length can be achieved via java toString or Matlab char
```
```xstr=toString(xBD)  or xstr=char(xBD)
```

Input: X,Y, function_case [X,Y double or str, function 1:X+Y, 2:X*Y, 3: X^Y(double)

Output: z (char variable)

Future Challenges:

```1. nchoosek_large (full precision)
2. Next Prime
3. factor_large
```

### Solution Stats

53.42% Correct | 46.58% Incorrect
Last Solution submitted on Apr 17, 2020