因子误差vb.net如果超过一定范围

时间:2015-10-21 23:58:20

标签: vb.net

我有以下用于在vb.net中查找factorial的代码

Function factorial(ByVal n As Integer) As Integer
    Dim Sum As Integer = 1
    For i = 2 To n
        Sum = Sum * i
    Next i
    factorial = Sum
End Function

在n = 12之后它给出了一个错误。我该如何解决?

感谢

0 个答案:

没有答案