overflow in exp(x) in python
What is happening is that you are overflowing the register such that it is overwriting itself. You have exceeded the maximum value that can be stored in the register. You will need to use a different datatype that will most likely not be compatible with exp(.). You might need a custom function that works with 64-bit Integers.
I'm using function: numpy.log(1+numpy.exp(z))
for small values of z (1-705) it gives identity result(1-705 {as expected}), 
but for larger value of z from 710+ it gives infinity, and throw error "runtimeWarning: overflow encountered in exp"