wasp256 - 1 year ago 68

Java Question

I'm using the math library in combination with the JexlEngine to calculate different equations. In this equations I also have the

`pow`

`math.pow(99999, 10000)`

Recommended for you: Get network issues from **WhatsUp Gold**. **Not end users.**

Answer Source

You can compare the exponent to

```
double base = 99999;
double maxExp = Math.log(Long.MAX_VALUE)/Math.log(base);
```

if the power is above maxExp, you will get an overflow.

Recommended from our users: **Dynamic Network Monitoring from WhatsUp Gold from IPSwitch**. ** Free Download**