n = Integer.Parse(iVal.Text)
x = Double.Parse(xVal.Text)
' fpoly = taylors(iter, x)
factorial = 1
poly = 0
Dim a As Integer
For a = 1 To n
factorial = factorial * a
If factorial Mod 2 = 0 Then
evenfac = factorial
Else
oddfac = factorial
End If
poly = poly + (Math.Pow(x, ((2 * a) - 1)) / ((oddfac)) + ((Math.Pow(2, (2 * a)) - Math.Pow(1, a)) - 1) * (Math.Pow(x, (2 * a)) / (evenfac)))
Next a
RichTextBox1.Text = poly.ToString
vonbv25 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.