主题:总是出现溢出?
代码如下
dim i As Single, a As Double, n As Integer
a = Val(InputBox("请输入年金数值", "年金数值"))
i = Val(InputBox("请输入利息率", "利率"))
n = Val(InputBox("请输入计息期数", "期数"))
Text1.Text = Str(a * (1 - (1 + i / 100)^ (-n)) / (i / 100))
运行后如果点击inputbox的取消按钮出现溢出,不知原因?望高手指点,高分给您。
dim i As Single, a As Double, n As Integer
a = Val(InputBox("请输入年金数值", "年金数值"))
i = Val(InputBox("请输入利息率", "利率"))
n = Val(InputBox("请输入计息期数", "期数"))
Text1.Text = Str(a * (1 - (1 + i / 100)^ (-n)) / (i / 100))
运行后如果点击inputbox的取消按钮出现溢出,不知原因?望高手指点,高分给您。