正如标题所示,当我使用math.exp()时出现溢出错误。由于我是新手和编程新手,我想要一些帮助。我在网上找了一个答案,但我找不到任何东西。 这是脚本:
Tmin = raw_input("\nEnter temperature value (min): (Press 00 to enter Mean Temperature!)\n")
Tmax = raw_input("\nEnter temperature value (max): (Press 00 to enter Mean Temperature!)\n")
if float(Tmin) > float(Tmax):
print ("Prepei Tmin < Tmax")
while float(Tmin) > float(Tmax):
Tmin = raw_input("\nEnter temperature value (min): (Press 00 to enter Mean Temperature!)\n")
Tmax = raw_input("\nEnter temperature value (max): (Press 00 to enter Mean Temperature!)\n")
if Tmin == ("00") and Tmax == ("00"):
Tmean = float(raw_input("Enter temperature value (mean): \n"))
else:
Tmean = ((Tmin)+Tmax)/2)
RHmin = raw_input("\nEnter relative humidity value (min): (Press 00 to enter Mean Relative Humidity!)\n")
RHmax = raw_input("\nEnter relative humidity value (max): (Press 00 to enter Mean Relative Humidity!)\n")
if float(RHmin) > float(RHmax):
print ("Prepei RHmin < RHmax")
while float(RHmin) > float(RHmax):
RHmin = raw_input("\nEnter relative humidity value (min): (Press 00 to enter Mean Relative Humidity!)\n")
RHmax = raw_input("\nEnter relative humidity value (max): (Press 00 to enter Mean Relative Humidity!)\n")
if RHmin == ("00") and RHmax == ("00"):
RHmean = float(raw_input("Enter relative humidity value (mean): \n"))
else:
RHmean = ((float(RHmin)+float(RHmax))/2)
import math
esmax = (0.61051 * (math.exp(17.27 * float(Tmax) + 273.3)))
esmin = (0.61051 * (math.exp(17.27 * float(Tmin) + 273.3)))
print Tmean , RHmean , esmax , esmin