Você está na página 1de 2

Dim intfirstnumber As Integer

Dim intsecondnumber As Integer


Dim additionresult2 As Integer
Sub test()

intfirstnumber = InputBox(prompt:="type the first integer")


intsecondnumber = InputBox(prompt:="type the second integer")
Call additionresult1

MsgBox intfirstnumber & "+" & intsecondnumber & "=" & additionresult2 & "."

End Sub
Sub additionresult1()
additionresult2 = intfirstnumber + intsecondnumber
End Sub
Function bs(s, x, t, r, sigma)

d1 = (Log(s / x) + (r + sigma ^ 2 / 2) * t) / (sigma * Sqr(t))


d2 = d1 - (sigma * Sqr(t))
bs = s * Application.WorksheetFunction.Norm_S_Dist(d1, True) - x * Exp(-r * t) *
Application.WorksheetFunction.Norm_S_Dist(d2, True)

Sub z1()

End Sub
Function gammax(n As Integer, beta As Double) As Double
Dim i As Integer
Dim x As Double
gammax = 0

For i = 1 To n
x = -beta * Log(Rnd)
gammax = gammax + x

Next i
End Function

Function poix(lamda As Double) As Integer


Dim u As Double
Dim f As Double
Dim p As Double
u = Rnd
f = Exp(-lamda)
poix = 0
p=f
While u > f
poix = poix + 1
p = p * lamda / poix
f=f+p
Wend
End Function

Você também pode gostar