应该是 Pi/4=1-1/3+1/5-1/7+…+(-1)^(n-1)/(2*n-1)吧,
Private Sub Form_Load()
Dim Pi As Single,i As Long
Form1.AutoRedraw = True
i = 1
Do
Pi = Pi + (-1) ^ (i - 1) / (2 * i - 1)
i = i + 1
Loop Until 1 / (i * 2 - 1) < 10 ^ (-6)
Pi = 4 * Pi
Print Pi
End Su
应该是 Pi/4=1-1/3+1/5-1/7+…+(-1)^(n-1)/(2*n-1)吧,
Private Sub Form_Load()
Dim Pi As Single,i As Long
Form1.AutoRedraw = True
i = 1
Do
Pi = Pi + (-1) ^ (i - 1) / (2 * i - 1)
i = i + 1
Loop Until 1 / (i * 2 - 1) < 10 ^ (-6)
Pi = 4 * Pi
Print Pi
End Su