I get a Overflow error when i try this calculation, but i cant figure out why.
1-math.exp(-4*1000000*-0.0641515994108)
The Python "OverflowError: math range error" occurs when the result of a mathematical calculation is too large. Use a try/except block to handle the error or use the numpy module if you have to manipulate larger numbers.
These errors can be handled by using exception handling. In the below section we will see about this exception handling. In the above programs, we saw the Overflow error that occurred when the current value exceeds the limit value. So to handle this we have to raise overflowError exception.
The number you're asking math.exp to calculate has, in decimal, over 110,000 digits. That's slightly outside of the range of a double, so it causes an overflow.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With