Professional Documents
Culture Documents
Código 2
Código 2
Else
End If
End Sub
Dim n As Integer
Dim x0 As Double
Dim x1 As Double
Dim tol As Double
Dim errorabs As Double
If WorksheetFunction.Count(Range("B2:B3")) = 0 Then
MsgBox "Faltan datos"
Range("B2").Select
Else
x0 = Range("B2").Value
tol = Range("B3").Value
n = 1
Do
x1 = g(x0)
errorabs = Abs(x1 - x0)
x0 = x1
Cells(n, 4) = n
Cells(n, 5) = x1
End If
End Sub
Function g(x)
g = x - 0.25 * (WorksheetFunction.Asin(x) - WorksheetFunction.Pi * x ^ 2
+ 1)
End Function