观察以下python程序
def goo(y,x):
y = float(y)
x = float(x)
yup = (y - x - 1) / x
yup = str(yup)
yup = yup.split(".")
decimal = "." + yup[1]
decimal = float(decimal)
output = decimal / (1/x)
print output
print int(output)
goo(9,5)
Run Code Online (Sandbox Code Playgroud)
当程序执行"打印输出"时,答案是3.0
当程序执行"print int(output)"时,答案是2
"print int(output)"应该执行以提供3而不是2
为什么会这样?