VBA
Maclauric Seires for Exp(x)
skyground21
2022. 7. 12. 09:55
반응형
Maclauric Seires for Exp(x)
Exp(x)함수를 VBA로 구현하기
Function MacExp(x)
Const Precision = 0.000000000000001
MacExp = 0
term = 1
k = 1
Do While Abs(term) > Precision
MacExp = MacExp + term
Debug.Print k; term; MacExp
term = term * x / k
k = k + 1
If k = 100 Then
MsgBox "Loop aborted, k > 100"
Exit Do
End If
Loop
End Function
출처 : A Guide to Microsoft Excel 2013 for Scientists and Engineers
반응형