math range error

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/jacke121/article/details/82889100
异常原因:
exp的值太大或者太小了。

try:
    ans = math.exp(200000)
except OverflowError:
    ans = float('inf')

猜你喜欢

转载自blog.csdn.net/jacke121/article/details/82889100