LastUpdate 8/11/2024 |
In the following equation , which is said to be the most beautiful equation
, pi , natural logarithm base e , imaginary number unit i , and natural
number 1 appear. Both the circular constant π and the base e of the natural logarithm are irrational numbers and become infinite decimals that don't circulate. A newspaper airticle reported that a man in his 50s from Nagano Prefecture calculated the approximate value of pi using his own personal computer , and found the correct approximate value of π to 5 trillion decimal places , and was registered in the Guiness Book of Records. It was on. In BC , Archimedes (BC287-BC212) determined the correct approximation of π to the second decimal place from a regular 96-gon inscribed and a regular 96-gon circumscribed in a circle. In the 17th centry , Rudolph of Holland (1540-1610) used the positive 2~62 polygon inscribed in a circle to obtain a correct approximation of π to 35 decimal places. He devoted his life to finding an approximation of pi. In about 2000 years from Archimedes (BC287-BC212) to Rudolph (1540-1610) , the correct approximation of pi has grown by only 35 places from 2 decimal places to 35 decimal places. From Archimedes to Rudolf , the approximation of pi was obtained using regular polygons inscribed and circumscribed in a circle. Since then , many people have discovered infinite reries that approximate pi , and have used them to approximate pi. Furthermore , with the development of computers , the number of digits of the approximation value of pi has incresed dramatically by computing these infinite series. Similar to pi , many infinite series have been found that approximate the base of the national logarithm. Please enjoy the experience of finding approximate values of pi and the base e of national rogarithms using infinite series on a personal computer , which has become more common these days , on this webside. 2.4.2011 written down. |
【1】 Approximation of pi by the sum of infinite series | ||||||||||||||||||
① The following infinite series was used to approximate π , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of π ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"pai01"」 , and press [Enter]. At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. n=1000000 Pai=3.1415916535897932739 ⑤ ExcelVBA program list Sub pai01() Dim n As Double Dim s As Double Range("C2:C3").Select Selection.ClearContents Range("b2") = "n =" Range("b3") = "π =" s = 0 For n = 1 To 1000000 DoEvents s = s + 1 / (2 * n - 1) * (-1) ^ (n + 1) Range("c2") = n Range("c3") = 4 * s Next n End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 7 , and the column width of column C to 22. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after the decimal point to 14. Make sure that cells B2 , B3 , C2 , and C3 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub pai01()" in the program listing. Execution → Click "Run Sub/Userform". The calculation result is displayed as follows. n=100266 Pai=3.14158268011915 ⑦ Discussion of trial results In ④ , the correct value of π to the 5th decimal place is obtained by the partial sum of one million terms of the infinite series. The speed of convergence of this infinite series is slow. |
【2】 Approximation of pi by the sum of infinite series | ||||||||||||||||||
① The following infinite series was used to approximate π , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of π ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"pai02"」 , and press [Enter]. At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. n=1999999 Pai=3.1415921535895765816 ⑤ ExcelVBA program list Sub pai02() Dim n As Double Dim s As Double Range("C2:C3").Select Selection.ClearContents Range("b2") = "n =" Range("b3") = "π =" s = 0 For n = 1 To 2000000 Step 2 DoEvents s = s + 1 / ((2 * n - 1) * (2 * n + 1)) Range("c2") = n Range("c3") = 8 * s Next n End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 7 , and the column width of column C to 22. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after the decimal point to 14. Make sure that cells B2 , B3 , C2 , and C3 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub pai02()" in the program listing. Execution → Click "Run Sub/Userform". The calculation result is displayed as follows. n=100637 Pai=3.14158271698536 ⑦ Discussion of trial results In ④ , the correct value of π to the 6th decimal place is obtained by the partial sum of one million terms of the infinite series. The speed of convergence of this infinite series is slow. |
【3】 Approximation of pi by the sum of infinite series | ||||||||||||||||||
① The following infinite series was used to approximate π , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of π ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"pai03"」 , and press [Enter]. At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. n=1000000 Pai=3.1415916986604411841 ⑤ ExcelVBA program list Sub pai03() Dim n As Double Dim s As Double Range("C2:C3").Select Selection.ClearContents Range("b2") = "n =" Range("b3") = "π =" s = 0 For n = 1 To 1000000 DoEvents s = s + 1 / (n * n) Range("c2") = n Range("c3") = Sqr(6 * s) Next n End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 7 , and the column width of column C to 22. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after the decimal point to 14. Make sure that cells B2 , B3 , C2 , and C3 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub pai03()" in the program listing. Execution → Click "Run Sub/Userform". The calculation result is displayed as follows. n=100251 Pai=3.14158312823501 ⑦ Discussion of trial results In ④ , the correct value of π to the 5th decimal place is obtained by the partial sum of one million terms of the infinite series. The speed of convergence of this infinite series is slow. |
【4】 Approximation of pi by the sum of infinite series | ||||||||||||||||||
① The following infinite series was used to approximate π , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of π ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"pai04"」 , and press [Enter]. At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. n=1999999 Pai=3.1415923352798564392 ⑤ ExcelVBA program list Sub pai04() Dim n As Double Dim s As Double Range("C2:C3").Select Selection.ClearContents Range("b2") = "n =" Range("b3") = "π =" s = 0 For n = 1 To 2000000 Step 2 DoEvents s = s + 1 / (n * n) Range("c2") = n Range("c3") = Sqr(8 * s) Next n End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 7 , and the column width of column C to 22. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after the decimal point to 14. Make sure that cells B2 , B3 , C2 , and C3 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub pai04()" in the program listing. Execution → Click "Run Sub/Userform". The calculation result is displayed as follows. n=100631 Pai=3.14158632736741 ⑦ Discussion of trial results In ④ , the correct value of π to the 6th decimal place is obtained by the partial sum of one million terms of the infinite series. The speed of convergence of this infinite series is slow. |
【5】 Approximation of pi by the sum of infinite series | ||||||||||||||||||
① The following infinite series was used to approximate π , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of π ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"pai05"」 , and press [Enter]. At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. n=2000000 Pai=3.1415916986603636762 ⑤ ExcelVBA program list Sub pai05() Dim n As Double Dim s As Double Range("C2:C3").Select Selection.ClearContents Range("b2") = "n =" Range("b3") = "π =" s = 0 For n = 2 To 2000000 Step 2 DoEvents s = s + 1 / (n * n) Range("c2") = n Range("c3") = Sqr(24 * s) Next n End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 7 , and the column width of column C to 22. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after the decimal point to 14. Make sure that cells B2 , B3 , C2 , and C3 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub pai05()" in the program listing. Execution → Click "Run Sub/Userform". The calculation result is displayed as follows. n=100492 Pai=3.141573648633311 ⑦ Discussion of trial results In ④ , the correct value of π to the 5th decimal place is obtained by the partial sum of one million terms of the infinite series. The speed of convergence of this infinite series is slow. |
【6】 Approximation of pi by the sum of infinite series | ||||||||||||||||||
① The following infinite series was used to approximate π , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of π ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"pai06"」 , and press [Enter]. At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. n=1000000 Pai=3.1415926535888382971 ⑤ ExcelVBA program list Sub pai06() Dim n As Double Dim s As Double Range("C2:C3").Select Selection.ClearContents Range("b2") = "n =" Range("b3") = "π =" s = 0 For n = 1 To 1000000 DoEvents s = s + 1 / (n * n) * (-1) ^ (n + 1) Range("c2") = n Range("c3") = Sqr(12 * s) Next n End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 7 , and the column width of column C to 22. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after the decimal point to 14. Make sure that cells B2 , B3 , C2 , and C3 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub pai06()" in the program listing. Execution → Click "Run Sub/Userform". The calculation result is displayed as follows. n=50582 Pai=3.14159265321654 ⑦ Discussion of trial results In ④ , the correct value of π to the 11th decimal place is obtained by the partial sum of one million terms of the infinite series. The speed of convergence of this infinite series is faster than that of 【1】~【5】. |
【7】 Approximation of pi by the sum of infinite series | ||||||||||||||||||
① The following infinite series was used to approximate π , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of π ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"pai07"」 , and press [Enter]. At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. n=1000000 Pai=3.1415918681920664862 ⑤ ExcelVBA program list Sub pai07() Dim n As Double Dim s As Double Range("C2:C3").Select Selection.ClearContents Range("b2") = "n =" Range("b3") = "π =" s = 1 For n = 1 To 1000000 DoEvents s = s * (2 * n * 2 * n) / ((2 * n - 1) * (2 * n + 1)) Range("c2") = n Range("c3") = 2 * s Next n End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 7 , and the column width of column C to 22. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after the decimal point to 14. Make sure that cells B2 , B3 , C2 , and C3 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub pai07()" in the program listing. Execution → Click "Run Sub/Userform". The calculation result is displayed as follows. n=100304 Pai=3.14158482346061 ⑦ Discussion of trial results In ④ , the correct value of π to the 5th decimal place is obtained by the partial sum of one million terms of the infinite series. The speed of convergence of this infinite series is slow. |
【8】 Approximation of pi by the sum of infinite series | ||||||||||||||||||
① The following infinite series was used to approximate π , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of π ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"pai08"」 , and press [Enter]. At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. n=3000000 Pai=3.141592304524066429 ⑤ ExcelVBA program list Sub pai08() Dim n As Double Dim s As Double Range("C2:C3").Select Selection.ClearContents Range("b2") = "n =" Range("b3") = "π =" s = 1 For n = 3 To 3000000 Step 3 DoEvents s = s * (n * n) / ((n - 1) * (n + 1)) Range("c2") = n Range("c3") = s * 3 * Sqr(3) / 2 Next n End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 7 , and the column width of column C to 22. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after the decimal point to 14. Make sure that cells B2 , B3 , C2 , and C3 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub pai08()" in the program listing. Execution → Click "Run Sub/Userform". The calculation result is displayed as follows. n=100656 Pai=3.14158225003501 ⑦ Discussion of trial results In ④ , the correct value of π to the 6th decimal place is obtained by the partial sum of one million terms of the infinite series. The speed of convergence of this infinite series is slow. |
【9】 Approximation of pi by the sum of infinite series | ||||||||||||||||||
① The following infinite series was used to approximate π , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of π ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"pai09"」 , and press [Enter]. At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. n=4000000 Pai=3.141592457240280029 ⑤ ExcelVBA program list Sub pai09() Dim n As Double Dim s As Double Range("C2:C3").Select Selection.ClearContents Range("b2") = "n =" Range("b3") = "π =" s = 1 For n = 4 To 4000000 Step 4 DoEvents s = s * (n * n) / ((n - 1) * (n + 1)) Range("c2") = n Range("c3") = s * 2 * Sqr(2) Next n End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 7 , and the column width of column C to 22. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after the decimal point to 14. Make sure that cells B2 , B3 , C2 , and C3 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub pai09()" in the program listing. Execution → Click "Run Sub/Userform". The calculation result is displayed as follows. n=100492 Pai=3.14158483822578 ⑦ Discussion of trial results In ④ , the correct value of π to the 6th decimal place is obtained by the partial sum of one million terms of the infinite series. The speed of convergence of this infinite series is slow. |
【10】 Approximation of pi by the sum of infinite series | ||||||||||||||||||
① The following infinite series was used to approximate π , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of π ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"pai10"」 , and press [Enter]. At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. n=6000000 Pai=3.1415925663232942048 ⑤ ExcelVBA program list Sub pai10() Dim n As Double Dim s As Double Range("C2:C3").Select Selection.ClearContents Range("b2") = "n =" Range("b3") = "π =" s = 1 For n = 6 To 6000000 Step 6 DoEvents s = s * (n * n) / ((n - 1) * (n + 1)) Range("c2") = n Range("c3") = s * 3 Next n End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 7 , and the column width of column C to 22. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after the decimal point to 14. Make sure that cells B2 , B3 , C2 , and C3 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub pai10()" in the program listing. Execution → Click "Run Sub/Userform". The calculation result is displayed as follows. n=101550 Pai=3.14158749767762 ⑦ Discussion of trial results In ④ , the correct value of π to the 6th decimal place is obtained by the partial sum of one million terms of the infinite series. The speed of convergence of this infinite series is slow. |
【11】 Approximation of pi by the sum of infinite series | ||||||||||||||||||
① The following infinite series was used to approximate π , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of π ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"pai11"」 , and press [Enter]. At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. n=36 Pai=3.1415926535897932381 ⑤ ExcelVBA program list Sub pai11() Dim n As Double Dim s As Double Range("C2:C3").Select Selection.ClearContents Range("b2") = "n =" Range("b3") = "π =" s = 1 For n = 1 To 36 DoEvents s = s + 1 / (2 * n + 1) * (1 / 3 ^ n) * (-1) ^ n Range("c2") = n Range("c3") = s * 2 * Sqr(3) Next n End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 7 , and the column width of column C to 22. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after the decimal point to 14. Make sure that cells B2 , B3 , C2 , and C3 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub pai11()" in the program listing. Execution → Click "Run Sub/Userform". The calculation result is displayed as follows. n=36 Pai=3.14159265358979 ⑦ Discussion of trial results In ④ , the correct value of π to the 18th decimal place is obtained by the partial sum of 36 terms of the infinite series. The speed of convergence of this infinite series is fast. |
【12】 Approximation of pi by the sum of infinite series | ||||||||||||||||||
① The following infinite series was used to approximate π , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of π ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"pai12"」 , and press [Enter]. At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. n=48 Pai=3.1415926535897932387 ⑤ ExcelVBA program list Sub pai12() Dim n As Double Dim s As Double Range("C2:C3").Select Selection.ClearContents Range("b2") = "n =" Range("b3") = "π =" s = 0 For n = 1 To 48 DoEvents s = s + (1 / (2 * n - 1)) * (1 / 2 ^ (2 * n - 1) + 1 / 3 ^ (2 * n - 1)) * (-1) ^ (n + 1) Range("c2") = n Range("c3") = 4 * s Next n End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 7 , and the column width of column C to 22. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after the decimal point to 14. Make sure that cells B2 , B3 , C2 , and C3 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub pai12()" in the program listing. Execution → Click "Run Sub/Userform". The calculation result is displayed as follows. n=48 Pai=3.14159265358979 ⑦ Discussion of trial results In ④ , the correct value of π to the 18th decimal place is obtained by the partial sum of 36 terms of the infinite series. The speed of convergence of this infinite series is fast. |
【13】 Approximation to the base e of natural logarithms by the sum of infinite series | ||||||||||||||||||||||||||||
① The following infinite series was used to approximate e , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of e ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"e01"」 , and press [Enter]. At the MS-DOS screen , type "point 10" , and press [Enter]. (48 digits) At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. m=20 e=2.718281828459045235339・・・ ⑤ ExcelVBA program ltst Sub e01() Dim t, s, m, n As Double Range("C2:C4").Select Selection.ClearContents t = 1 Range("b2") = "m =" Range("b3") = "e =" Range("b4") = "Exp(1) =" For m = 1 To 20 DoEvents s = 1 For n = 1 To m s = s * 1 / n Next n t = t + s Range("c2") = m Range("c3") = t Next m Range("c4") = Exp(1) End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 10 , and the column width of column C to 20. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 14. Right-click on cell C4 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 14. Make sure that cells B2 , B3 , B4 , C2 , C3 , and C4 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub01()" in the program listing Execution → Click "Run Sub/Userform" The calculation result is displayed as follows. m=20 e=2.71828182845905 ⑦ Discussion of trial results In ④ ,the correct value of e to the 19th decimal place is obtained by the partial sum of 20 terms of infinite series. The speed of convergence of this infinite series is fast. |
【14】 Approximation to the base e of natural logarithms by the sum of infinite series | ||||||||||||||||||||||||||||
① The following infinite series was used to approximate e , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of e ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"e02"」 , and press [Enter]. At the MS-DOS screen , type "point 10" , and press [Enter]. (48 digits) At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. m=20 1/e=0.36787944117144232161・・・ ⑤ ExcelVBA program ltst Sub e02() Dim t, s, m, n As Double Range("C2:C4").Select Selection.ClearContents t = 1 Range("b2") = "m =" Range("b3") = "1/e =" Range("b4") = "1/Exp(1) =" For m = 1 To 20 DoEvents s = 1 For n = 1 To m s = s * 1 / n Next n t = t + s * (-1) ^ (n + 1) Range("c2") = m Range("c3") = t Next m Range("c4") = 1 / Exp(1) End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 10 , and the column width of column C to 20. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 14. Right-click on cell C4 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 14. Make sure that cells B2 , B3 , B4 , C2 , C3 , and C4 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub02()" in the program listing Execution → Click "Run Sub/Userform" The calculation result is displayed as follows. m=20 1/e=0.36787944117144 ⑦ Discussion of trial results In ④ ,the correct value of e to the 18th decimal place is obtained by the partial sum of 20 terms of infinite series. The speed of convergence of this infinite series is fast. |
【15】 Approximation to the base e of natural logarithms by the sum of infinite series | ||||||||||||||||||||||||||||
① The following infinite series was used to approximate e , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of e ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"e03"」 , and press [Enter]. At the MS-DOS screen , type "point 10" , and press [Enter]. (48 digits) At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. m=20 e=2.7182818284590452349・・・ ⑤ ExcelVBA program ltst Sub e03() Dim t, s, m, n As Double Range("C2:C4").Select Selection.ClearContents t = 0 Range("b2") = "m =" Range("b3") = "e =" Range("b4") = "Exp(1) =" For m = 1 To 20 DoEvents s = 1 For n = 1 To m s= s * 1 / n Next n t = t + s * m Range("c2") = m Range("c3") = t Next m Range("c4") = Exp(1) End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 10 , and the column width of column C to 20. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 14. Right-click on cell C4 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 14. Make sure that cells B2 , B3 , B4 , C2 , C3 , and C4 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub03()" in the program listing Execution → Click "Run Sub/Userform" The calculation result is displayed as follows. m=20 e=2.71828182845905 ⑦ Discussion of trial results In ④ ,the correct value of e to the 17th decimal place is obtained by the partial sum of 20 terms of infinite series. The speed of convergence of this infinite series is fast. |
【16】 Approximation to the base e of natural logarithms by the sum of infinite series | ||||||||||||||||||||||||||||
① The following infinite series was used to approximate e , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of e ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"e04"」 , and press [Enter]. At the MS-DOS screen , type "point 10" , and press [Enter]. (48 digits) At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. m=20 e=2.718281828459045235339・・・ ⑤ ExcelVBA program ltst Sub e04() Dim t, s, m, n As Double Range("C2:C4").Select Selection.ClearContents t = 1 Range("b2") = "m =" Range("b3") = "e =" Range("b4") = "Exp(1) =" For m = 2 To 20 Step 2 DoEvents s = 1 For n = 1 To m s = s * 1 / n Next n t = t + s * (m + 1) Range("c2") = m Range("c3") = t Next m Range("c4") = Exp(1) End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 10 , and the column width of column C to 20. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 14. Right-click on cell C4 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 14. Make sure that cells B2 , B3 , B4 , C2 , C3 , and C4 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub04()" in the program listing Execution → Click "Run Sub/Userform" The calculation result is displayed as follows. m=20 e=2.71828182845905 ⑦ Discussion of trial results In ④ ,the correct value of e to the 19th decimal place is obtained by the partial sum of 10 terms of infinite series. The speed of convergence of this infinite series is fast. |
【17】 Approximation to the base e of natural logarithms by the sum of infinite series | ||||||||||||||||||||||||||||
① The following infinite series was used to approximate e , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of e ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"e05"」 , and press [Enter]. At the MS-DOS screen , type "point 10" , and press [Enter]. (48 digits) At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. m=10 e=2.7182818284590452349・・・ ⑤ ExcelVBA program ltst Sub e05() Dim t, s, m, n As Double Range("C2:C4").Select Selection.ClearContents t = 0 Range("b2") = "m =" Range("b3") = "e =" Range("b4") = "Exp(1) =" For m = 1 To 10 DoEvents s = 1 For n = 1 To (2 * m - 1) s = s * 1 / n Next n t = t + s * m Range("c2") = m Range("c3") = t * 2 Next m Range("c4") = Exp(1) End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 10 , and the column width of column C to 20. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 14. Right-click on cell C4 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 14. Make sure that cells B2 , B3 , B4 , C2 , C3 , and C4 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub05()" in the program listing Execution → Click "Run Sub/Userform" The calculation result is displayed as follows. m=10 e=2.71828182845904 ⑦ Discussion of trial results In ④ ,the correct value of e to the 17th decimal place is obtained by the partial sum of 10 terms of infinite series. The speed of convergence of this infinite series is fast. |
【18】 Approximation to the base e of natural logarithms by the sum of infinite series | ||||||||||||||||||||||||||||
① The following infinite series was used to approximate e , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of e ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"e06"」 , and press [Enter]. At the MS-DOS screen , type "point 10" , and press [Enter]. (48 digits) At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. m=18 1/e=0.36787944117144232120・・・ ⑤ ExcelVBA program ltst Sub e06() Dim t, s, m, n As Double Range("C2:C4").Select Selection.ClearContents t = 0 Range("b2") = "m =" Range("b3") = "1/e =" Range("b4") = "1/Exp(1) =" For m = 3 To 17 Step 2 DoEvents s = 1 For n = 1 To m s = s * 1 / n Next n t = t + s * (m - 1) Range("c2") = m Range("c3") = t Next m Range("c4") = 1 / Exp(1) End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 10 , and the column width of column C to 20. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 14. Right-click on cell C4 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 14. Make sure that cells B2 , B3 , B4 , C2 , C3 , and C4 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub06()" in the program listing Execution → Click "Run Sub/Userform" The calculation result is displayed as follows. m=20 1/e=0.36787944117144 ⑦ Discussion of trial results In ④ ,the correct value of e to the 18th decimal place is obtained by the partial sum of 9 terms of infinite series. The speed of convergence of this infinite series is fast. |
【19】 Approximation to the base e of natural logarithms by the sum of infinite series | ||||||||||||||||||||||||||||
① The following infinite series was used to approximate e , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of e ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"e07"」 , and press [Enter]. At the MS-DOS screen , type "point 10" , and press [Enter]. (48 digits) At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. m=20 e=2.71828182845904523513・・・ ⑤ ExcelVBA program ltst Sub e07() Dim t, s, m, n As Double Range("C2:C4").Select Selection.ClearContents t = 1 Range("b2") = "m =" Range("b3") = "e =" Range("b4") = "Exp(1) =" For m = 1 To 20 DoEvents s = 1 For n = 1 To m s = s * 1 / n Next n t = t + s * (m + 1) Range("c2") = m Range("c3") = t / 2 Next m Range("c4") = Exp(1) End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 10 , and the column width of column C to 20. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 14. Right-click on cell C4 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 14. Make sure that cells B2 , B3 , B4 , C2 , C3 , and C4 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub07()" in the program listing Execution → Click "Run Sub/Userform" The calculation result is displayed as follows. m=20 e=2.71828182845905 ⑦ Discussion of trial results In ④ ,the correct value of e to the 18th decimal place is obtained by the partial sum of 20 terms of infinite series. The speed of convergence of this infinite series is fast. |
【20】 Approximation to the base e of natural logarithms by the sum of infinite series | ||||||||||||||||||||||||||||
① The following infinite series was used to approximate e , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of e ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"e08"」 , and press [Enter]. At the MS-DOS screen , type "point 10" , and press [Enter]. (48 digits) At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. m=20 e=2.7182818284590452308・・・ ⑤ ExcelVBA program ltst Sub e08() Dim t, s, m, n As Double Range("C2:C4").Select Selection.ClearContents t = 0 Range("b2") = "m =" Range("b3") = "e =" Range("b4") = "Exp(1) =" For m = 1 To 20 DoEvents s = 1 For n = 1 To m s = s * 1 / n Next n t = t + s * m ^ 2 Range("c2") = m Range("c3") = t / 2 Next m Range("c4") = Exp(1) End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 10 , and the column width of column C to 20. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 14. Right-click on cell C4 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 14. Make sure that cells B2 , B3 , B4 , C2 , C3 , and C4 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub08()" in the program listing Execution → Click "Run Sub/Userform" The calculation result is displayed as follows. m=20 e=2.71828182845905 ⑦ Discussion of trial results In ④ ,the correct value of e to the 17th decimal place is obtained by the partial sum of 20 terms of infinite series. The speed of convergence of this infinite series is fast. |
【21】 Approximation to the base e of natural logarithms by the sum of infinite series | ||||||||||||||||||||||||||||
① The following infinite series was used to approximate e , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of e ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"e09"」 , and press [Enter]. At the MS-DOS screen , type "point 10" , and press [Enter]. (48 digits) At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. m=20 e=2.718281828459045227・・・ ⑤ ExcelVBA program ltst Sub e09() Dim t, s, m, n As Double Range("C2:C4").Select Selection.ClearContents t = 0 Range("b2") = "m =" Range("b3") = "e =" Range("b4") = "Exp(1) =" For m = 1 To 20 DoEvents s = 1 For n = 1 To m s = s * 1 / n Next n t = t + s * (m - 1) ^ 2 Range("c2") = m Range("c3") = t + 1 Next m Range("c4") = Exp(1) End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 10 , and the column width of column C to 20. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 14. Right-click on cell C4 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 14. Make sure that cells B2 , B3 , B4 , C2 , C3 , and C4 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub09()" in the program listing Execution → Click "Run Sub/Userform" The calculation result is displayed as follows. m=20 e=2.71828182845905 ⑦ Discussion of trial results In ④ ,the correct value of e to the 16th decimal place is obtained by the partial sum of 20 terms of infinite series. The speed of convergence of this infinite series is fast. |
【22】 Approximation to the base e of natural logarithms by the sum of infinite series | ||||||||||||||||||||||||||||
① The following infinite series was used to approximate e , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of e ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"e10"」 , and press [Enter]. At the MS-DOS screen , type "point 10" , and press [Enter]. (48 digits) At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. m=20 e=2.7182818284590452333・・・ ⑤ ExcelVBA program ltst Sub e10() Dim t, s, m, n As Double Range("C2:C4").Select Selection.ClearContents t = 1 Range("b2") = "m =" Range("b3") = "e =" Range("b4") = "Exp(1) =" For m = 1 To 20 DoEvents s = 1 For n = 1 To m s = s * 1 / n Next n t = t + s * (m + 1) ^ 2 Range("c2") = m Range("c3") = t / 5 Next m Range("c4") = Exp(1) End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 10 , and the column width of column C to 20. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 14. Right-click on cell C4 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 14. Make sure that cells B2 , B3 , B4 , C2 , C3 , and C4 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub10()" in the program listing Execution → Click "Run Sub/Userform" The calculation result is displayed as follows. m=20 e=2.71828182845905 ⑦ Discussion of trial results In ④ ,the correct value of e to the 17th decimal place is obtained by the partial sum of 20 terms of infinite series. The speed of convergence of this infinite series is fast. |
【23】 Approximation to the base e of natural logarithms by the sum of infinite series | ||||||||||||||||||||||||||||
① The following infinite series was used to approximate e , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of e ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"e11"」 , and press [Enter]. At the MS-DOS screen , type "point 10" , and press [Enter]. (48 digits) At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. m=20 e=2.718281828459045226・・・ ⑤ ExcelVBA program ltst Sub e11() Dim t, s, m, n As Double Range("C2:C4").Select Selection.ClearContents t = 0 Range("b2") = "m =" Range("b3") = "e =" Range("b4") = "Exp(1) =" For m = 2 To 20 DoEvents s = 1 For n = 1 To m s = s * 1 / n Next n t = t + s * (m - 1) * (m + 1) Range("c2") = m Range("c3") = t - 1 Next m Range("c4") = Exp(1) End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 10 , and the column width of column C to 20. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 14. Right-click on cell C4 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 14. Make sure that cells B2 , B3 , B4 , C2 , C3 , and C4 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub11()" in the program listing Execution → Click "Run Sub/Userform" The calculation result is displayed as follows. m=20 e=2.71828182845904 ⑦ Discussion of trial results In ④ ,the correct value of e to the 16th decimal place is obtained by the partial sum of 20 terms of infinite series. The speed of convergence of this infinite series is fast. |
【24】 Approximation to the base e of natural logarithms by the sum of infinite series | ||||||||||||||||||||||||||||||
① The following infinite series was used to approximate e , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of e ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"e12"」 , and press [Enter]. At the MS-DOS screen , type "point 10" , and press [Enter]. (48 digits) At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. m=20 e=2.7182818284590452321・・・ ⑤ ExcelVBA program ltst Sub e12() Dim t, s, ss, m, n As Double Range("C2:C4").Select Selection.ClearContents t = 0 Range("b2") = "m =" Range("b3") = "e =" Range("b4") = "Exp(1) =" For m = 1 To 20 DoEvents s = 1: ss = 0 For n = 1 To m s = s * 1 / n ss = ss + n Next n t = t + s * ss Range("c2") = m Range("c3") = t * 2 / 3 Next m Range("c4") = Exp(1) End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 10 , and the column width of column C to 20. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 14. Right-click on cell C4 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 14. Make sure that cells B2 , B3 , B4 , C2 , C3 , and C4 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub12()" in the program listing Execution → Click "Run Sub/Userform" The calculation result is displayed as follows. m=20 e=2.71828182845904 ⑦ Discussion of trial results In ④ ,the correct value of e to the 17th decimal place is obtained by the partial sum of 20 terms of infinite series. The speed of convergence of this infinite series is fast. |
【25】 Approximation to the base e of natural logarithms by the sum of infinite series | ||||||||||||||||||||||||||||
① The following infinite series was used to approximate e , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of e ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"e13"」 , and press [Enter]. At the MS-DOS screen , type "point 10" , and press [Enter]. (48 digits) At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. m=20 e=2.71828182845904517・・・ ⑤ ExcelVBA program ltst Sub e13() Dim t, s, m, n As Double Range("C2:C4").Select Selection.ClearContents t = 0 Range("b2") = "m =" Range("b3") = "e =" Range("b4") = "Exp(1) =" For m = 2 To 20 DoEvents s = 1 For n = 1 To m s = s * 1 / n Next n t = t + s * (m - 1) * (m ^ 2 + 1) Range("c2") = m Range("c3") = (t - 1) / 3 Next m Range("c4") = Exp(1) End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 10 , and the column width of column C to 20. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 14. Right-click on cell C4 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 14. Make sure that cells B2 , B3 , B4 , C2 , C3 , and C4 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub13()" in the program listing Execution → Click "Run Sub/Userform" The calculation result is displayed as follows. m=20 e=2.71828182845905 ⑦ Discussion of trial results In ④ ,the correct value of e to the 15th decimal place is obtained by the partial sum of 20 terms of infinite series. The speed of convergence of this infinite series is fast. |
【26】 Approximation to the base e of natural logarithms by the sum of infinite series | ||||||||||||||||||||||||||||
① The following infinite series was used to approximate e , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of e ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"e14"」 , and press [Enter]. At the MS-DOS screen , type "point 10" , and press [Enter]. (48 digits) At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. m=20 e=2.71828182845904517・・・ ⑤ ExcelVBA program ltst Sub e14() Dim t, s, m, n As Double Range("C2:C4").Select Selection.ClearContents t = 0 Range("b2") = "m =" Range("b3") = "e =" Range("b4") = "Exp(1) =" For m = 2 To 20 DoEvents s = 1 For n = 1 To m s = s * 1 / n Next n t = t + s * (m - 1) * (m ^ 2) Range("c2") = m Range("c3") = t / 3 Next m Range("c4") = Exp(1) End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 10 , and the column width of column C to 20. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 14. Right-click on cell C4 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 14. Make sure that cells B2 , B3 , B4 , C2 , C3 , and C4 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub14()" in the program listing Execution → Click "Run Sub/Userform" The calculation result is displayed as follows. m=20 e=2.71828182845904 ⑦ Discussion of trial results In ④ ,the correct value of e to the 15th decimal place is obtained by the partial sum of 20 terms of infinite series. The speed of convergence of this infinite series is fast. |
【27】 Approximation to the base e of natural logarithms by the sum of infinite series | ||||||||||||||||||||||||||||
① The following infinite series was used to approximate e , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of e ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"e15"」 , and press [Enter]. At the MS-DOS screen , type "point 10" , and press [Enter]. (48 digits) At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. m=20 e=2.71828182845904517・・・ ⑤ ExcelVBA program ltst Sub e15() Dim t, s, m, n As Double Range("C2:C4").Select Selection.ClearContents t = 0 Range("b2") = "m =" Range("b3") = "e =" Range("b4") = "Exp(1) =" For m = 2 To 20 DoEvents s = 1 For n = 1 To m s = s * 1 / n Next n t = t + s * (m - 1) * (m ^ 2 - 1) Range("c2") = m Range("c3") = (t + 1) / 3 Next m Range("c4") = Exp(1) End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 10 , and the column width of column C to 20. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 14. Right-click on cell C4 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 14. Make sure that cells B2 , B3 , B4 , C2 , C3 , and C4 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub15()" in the program listing Execution → Click "Run Sub/Userform" The calculation result is displayed as follows. m=20 e=2.71828182845904 ⑦ Discussion of trial results In ④ ,the correct value of e to the 15th decimal place is obtained by the partial sum of 20 terms of infinite series. The speed of convergence of this infinite series is fast. |
【28】 Approximation of 1 by the sum of infinite series | ||||||||||||||||||
① The following infinite series was used to approximate 1 , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of 1 ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"one01"」 , and press [Enter]. At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. n=50 S=0.9999999999999991118 ⑤ ExcelVBA program list Sub one01() Dim n As Double Dim s As Double Range("C2:C3").Select Selection.ClearContents Range("b2") = "n =" Range("b3") = "S =" s = 0 For n = 1 To 50 DoEvents s = s + (1 / 2) * (1 / 2) ^ (n - 1) Range("c2") = n Range("c3") = s Next n End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 8 , and the column width of column C to 26. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 15. Make sure that cells B2 , B3 , C2 , and C3 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub one01()" in the program listing Execution → Click "Run Sub/Userform" The calculation result is displayed as follows. n=50 S=0.999999999999999 ⑦ Discussion of trial results The speed of convergence of this infinite series is fast. |
【29】 Approximation of 1 by the sum of infinite series | ||||||||||||||||||
① The following infinite series was used to approximate 1 , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of 1 ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"one02"」 , and press [Enter]. At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. n=50 S=0.9999999999999999968 ⑤ ExcelVBA program list Sub one02() Dim n As Double Dim s As Double Range("C2:C3").Select Selection.ClearContents Range("b2") = "n =" Range("b3") = "S =" s = 0 For n = 1 To 30 DoEvents s = s + (2 / 3) * (1 / 3) ^ (n - 1) Range("c2") = n Range("c3") = s Next n End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 8 , and the column width of column C to 26. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 15. Make sure that cells B2 , B3 , C2 , and C3 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub one02()" in the program listing Execution → Click "Run Sub/Userform" The calculation result is displayed as follows. n=30 S=0.999999999999995 ⑦ Discussion of trial results The speed of convergence of this infinite series is fast. |
【30】 Approximation of 1 by the sum of infinite series | ||||||||||||||||||
① The following infinite series was used to approximate 1 , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of 1 ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"one03"」 , and press [Enter]. At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. n=30 S=0.9999999999999999991 ⑤ ExcelVBA program list Sub one03() Dim n As Double Dim s As Double Range("C2:C3").Select Selection.ClearContents Range("b2") = "n =" Range("b3") = "S =" s = 0 For n = 1 To 20 DoEvents s = s + (3 / 4) * (1 / 4) ^ (n - 1) Range("c2") = n Range("c3") = s Next n End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 8 , and the column width of column C to 26. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 15. Make sure that cells B2 , B3 , C2 , and C3 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub one03()" in the program listing Execution → Click "Run Sub/Userform" The calculation result is displayed as follows. n=20 S=0.999999999999091 ⑦ Discussion of trial results The speed of convergence of this infinite series is fast. |
【31】 Approximation of 1 by the sum of infinite series | ||||||||||||||||||
① The following infinite series was used to approximate 1 , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of 1 ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"one04"」 , and press [Enter]. At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. n=50 S=0.9999999999999999967 ⑤ ExcelVBA program list Sub one04() Dim n As Double Dim s As Double Range("C2:C3").Select Selection.ClearContents Range("b2") = "n =" Range("b3") = "S =" s = 0 For n = 1 To 20 DoEvents s = s + (4 / 5) * (1 / 5) ^ (n - 1) Range("c2") = n Range("c3") = s Next n End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 8 , and the column width of column C to 26. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 15. Make sure that cells B2 , B3 , C2 , and C3 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub one04()" in the program listing Execution → Click "Run Sub/Userform" The calculation result is displayed as follows. n=20 S=0.999999999999990 ⑦ Discussion of trial results The speed of convergence of this infinite series is fast. |
【32】 Approximation of 1 by the sum of infinite series | ||||||||||||||||||
① The following infinite series was used to approximate 1 , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of 1 ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"one05"」 , and press [Enter]. At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. n=50 S=0.9999999999999999966 ⑤ ExcelVBA program list Sub one05() Dim n As Double Dim s As Double Range("C2:C3").Select Selection.ClearContents Range("b2") = "n =" Range("b3") = "S =" s = 0 For n = 1 To 10 DoEvents s= s + (5 / 6) * (1 / 6) ^ (n - 1) Range("c2") = n Range("c3") = s Next n End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 8 , and the column width of column C to 26. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 15. Make sure that cells B2 , B3 , C2 , and C3 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub one05()" in the program listing Execution → Click "Run Sub/Userform" The calculation result is displayed as follows. n=10 S=0.999999983461828 ⑦ Discussion of trial results The speed of convergence of this infinite series is fast. |
【33】 Approximation of 1 by the sum of infinite series | ||||||||||||||||||
① The following infinite series was used to approximate 1 , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of 1 ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"one06"」 , and press [Enter]. At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. n=50 S=0.9999999999999999962 ⑤ ExcelVBA program list Sub one06() Dim n As Double Dim s As Double Range("C2:C3").Select Selection.ClearContents Range("b2") = "n =" Range("b3") = "S =" s = 0 For n = 1 To 10 DoEvents s = s + (6 / 7) * (1 / 7) ^ (n - 1) Range("c2") = n Range("c3") = s Next n End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 8 , and the column width of column C to 26. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 15. Make sure that cells B2 , B3 , C2 , and C3 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub one06()" in the program listing Execution → Click "Run Sub/Userform" The calculation result is displayed as follows. n=10 S=0.999999996459867 ⑦ Discussion of trial results The speed of convergence of this infinite series is fast. |
【34】 Approximation of 1 by the sum of infinite series | ||||||||||||||||||
① The following infinite series was used to approximate 1 , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of 1 ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"one07"」 , and press [Enter]. At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. n=50 S=0.9999999999999999998 ⑤ ExcelVBA program list Sub one07() Dim n As Double Dim s As Double Range("C2:C3").Select Selection.ClearContents Range("b2") = "n =" Range("b3") = "S =" s = 0 For n = 1 To 10 DoEvents s = s + (7 / 8) * (1 / 8) ^ (n - 1) Range("c2") = n Range("c3") = s Next n End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 8 , and the column width of column C to 26. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 15. Make sure that cells B2 , B3 , C2 , and C3 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub one07()" in the program listing Execution → Click "Run Sub/Userform" The calculation result is displayed as follows. n=10 S=0.999999999068677 ⑦ Discussion of trial results The speed of convergence of this infinite series is fast. |
【35】 Approximation of 1 by the sum of infinite series | ||||||||||||||||||
① The following infinite series was used to approximate 1 , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of 1 ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"one08"」 , and press [Enter]. At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. n=50 S=0.9999999999999999943 ⑤ ExcelVBA program list Sub one08() Dim n As Double Dim s As Double Range("C2:C3").Select Selection.ClearContents Range("b2") = "n =" Range("b3") = "S =" s = 0 For n = 1 To 10 DoEvents s = s + (8 / 9) * (1 / 9) ^ (n - 1) Range("c2") = n Range("c3") = s Next n End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 8 , and the column width of column C to 26. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 15. Make sure that cells B2 , B3 , C2 , and C3 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub one08()" in the program listing Execution → Click "Run Sub/Userform" The calculation result is displayed as follows. n=10 S=0.999999999713203 ⑦ Discussion of trial results The speed of convergence of this infinite series is fast. |
【36】 Approximation of 1 by the sum of infinite series | ||||||||||||||||||
① The following infinite series was used to approximate 1 , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of 1 ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"one09"」 , and press [Enter]. At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. n=50 S=0.9999999999999999952 ⑤ ExcelVBA program list Sub one09() Dim n As Double Dim s As Double Range("C2:C3").Select Selection.ClearContents Range("b2") = "n =" Range("b3") = "S =" s = 0 For n = 1 To 10 DoEvents s = s + (9 / 10) * (1 / 10) ^ (n - 1) Range("c2") = n Range("c3") = s Next n End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 8 , and the column width of column C to 26. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 15. Make sure that cells B2 , B3 , C2 , and C3 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub one09()" in the program listing Execution → Click "Run Sub/Userform" The calculation result is displayed as follows. n=10 S=0.999999999900000 ⑦ Discussion of trial results The speed of convergence of this infinite series is fast. |
【37】 Approximation of 1 by the sum of infinite series | ||||||||||||||||||
① The following infinite series was used to approximate 1 , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of 1 ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"one10"」 , and press [Enter]. At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. n=50 S=0.9999999999999991118 ⑤ ExcelVBA program list Sub one10() Dim n As Double Dim s As Double Range("C2:C3").Select Selection.ClearContents Range("b2") = "n =" Range("b3") = "S =" s = 0 For n = 1 To 50 DoEvents s = s + (3 / 2) * (-1 / 2) ^ (n - 1) Range("c2") = n Range("c3") = s Next n End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 8 , and the column width of column C to 26. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 15. Make sure that cells B2 , B3 , C2 , and C3 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub one10()" in the program listing Execution → Click "Run Sub/Userform" The calculation result is displayed as follows. n=50 S=0.999999999999999 ⑦ Discussion of trial results The speed of convergence of this infinite series is fast. |
【38】 Approximation of 1 by the sum of infinite series | ||||||||||||||||||
① The following infinite series was used to approximate 1 , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of 1 ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"one11"」 , and press [Enter]. At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. n=50 S=1.0000000000000000003 ⑤ ExcelVBA program list Sub one11() Dim n As Double Dim s As Double Range("C2:C3").Select Selection.ClearContents Range("b2") = "n =" Range("b3") = "S =" s = 0 For n = 1 To 30 DoEvents s = s + (4 / 3) * (-1 / 3) ^ (n - 1) Range("c2") = n Range("c3") = s Next n End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 8 , and the column width of column C to 26. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 15. Make sure that cells B2 , B3 , C2 , and C3 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub one11()" in the program listing Execution → Click "Run Sub/Userform" The calculation result is displayed as follows. n=30 S=0.999999999999995 ⑦ Discussion of trial results The speed of convergence of this infinite series is fast. |
【39】 Approximation of 1 by the sum of infinite series | ||||||||||||||||||
① The following infinite series was used to approximate 1 , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of 1 ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"one12"」 , and press [Enter]. At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. n=30 S=0.9999999999999999991 ⑤ ExcelVBA program list Sub one12() Dim n As Double Dim s As Double Range("C2:C3").Select Selection.ClearContents Range("b2") = "n =" Range("b3") = "S =" s = 0 For n = 1 To 20 DoEvents s = s + (5 / 4) * (-1 / 4) ^ (n - 1) Range("c2") = n Range("c3") = s Next n End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 8 , and the column width of column C to 26. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 15. Make sure that cells B2 , B3 , C2 , and C3 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub one12()" in the program listing Execution → Click "Run Sub/Userform" The calculation result is displayed as follows. n=20 S=0.999999999999091 ⑦ Discussion of trial results The speed of convergence of this infinite series is fast. |
【40】 Approximation of 1 by the sum of infinite series | ||||||||||||||||||
① The following infinite series was used to approximate 1 , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of 1 ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"one13"」 , and press [Enter]. At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. n=50 S=1.0000000000000000001 ⑤ ExcelVBA program list Sub one13() Dim n As Double Dim s As Double Range("C2:C3").Select Selection.ClearContents Range("b2") = "n =" Range("b3") = "S =" s = 0 For n = 1 To 20 DoEvents s = s + (6 / 5) * (-1 / 5) ^ (n - 1) Range("c2") = n Range("c3") = s Next n End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 8 , and the column width of column C to 26. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 15. Make sure that cells B2 , B3 , C2 , and C3 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub one13()" in the program listing Execution → Click "Run Sub/Userform" The calculation result is displayed as follows. n=20 S=0.999999999999989 ⑦ Discussion of trial results The speed of convergence of this infinite series is fast. |
【41】 Approximation of 1 by the sum of infinite series | ||||||||||||||||||
① The following infinite series was used to approximate 1 , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of 1 ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"one14"」 , and press [Enter]. At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. n=50 S=1.0000000000000000003 ⑤ ExcelVBA program list Sub one14() Dim n As Double Dim s As Double Range("C2:C3").Select Selection.ClearContents Range("b2") = "n =" Range("b3") = "S =" s = 0 For n = 1 To 10 DoEvents s = s + (7 / 6) * (-1 / 6) ^ (n - 1) Range("c2") = n Range("c3") = s Next n End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 8 , and the column width of column C to 26. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 15. Make sure that cells B2 , B3 , C2 , and C3 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub one14()" in the program listing Execution → Click "Run Sub/Userform" The calculation result is displayed as follows. n=10 S=0.999999983461829 ⑦ Discussion of trial results The speed of convergence of this infinite series is fast. |
【42】 Approximation of 1 by the sum of infinite series | ||||||||||||||||||
① The following infinite series was used to approximate 1 , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of 1 ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"one15"」 , and press [Enter]. At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. n=20 S=0.9999999999999999875 ⑤ ExcelVBA program list Sub one15() Dim n As Double Dim s As Double Range("C2:C3").Select Selection.ClearContents Range("b2") = "n =" Range("b3") = "S =" s = 0 For n = 1 To 10 DoEvents s = s + (8 / 7) * (-1 / 7) ^ (n - 1) Range("c2") = n Range("c3") = s Next n End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 8 , and the column width of column C to 26. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 15. Make sure that cells B2 , B3 , C2 , and C3 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub one15()" in the program listing Execution → Click "Run Sub/Userform" The calculation result is displayed as follows. n=10 S=0.999999996459867 ⑦ Discussion of trial results The speed of convergence of this infinite series is fast. |
【43】 Approximation of 1 by the sum of infinite series | ||||||||||||||||||
① The following infinite series was used to approximate 1 , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of 1 ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"one16"」 , and press [Enter]. At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. n=20 S=0.9999999999999999991 ⑤ ExcelVBA program list Sub one16() Dim n As Double Dim s As Double Range("C2:C3").Select Selection.ClearContents Range("b2") = "n =" Range("b3") = "S =" s = 0 For n = 1 To 10 DoEvents s = s + (9 / 8) * (-1 / 8) ^ (n - 1) Range("c2") = n Range("c3") = s Next n End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 8 , and the column width of column C to 26. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 15. Make sure that cells B2 , B3 , C2 , and C3 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub one16()" in the program listing Execution → Click "Run Sub/Userform" The calculation result is displayed as follows. n=10 S=0.999999999068677 ⑦ Discussion of trial results The speed of convergence of this infinite series is fast. |
【44】 Approximation of 1 by the sum of infinite series | ||||||||||||||||||
① The following infinite series was used to approximate 1 , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of 1 ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"one17"」 , and press [Enter]. At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. n=10 S=0.9999999997132028009 ⑤ ExcelVBA program list Sub one17() Dim n As Double Dim s As Double Range("C2:C3").Select Selection.ClearContents Range("b2") = "n =" Range("b3") = "S =" s = 0 For n = 1 To 10 DoEvents s = s + (10 / 9) * (-1 / 9) ^ (n - 1) Range("c2") = n Range("c3") = s Next n End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 8 , and the column width of column C to 26. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 15. Make sure that cells B2 , B3 , C2 , and C3 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub one17()" in the program listing Execution → Click "Run Sub/Userform" The calculation result is displayed as follows. n=10 S=0.999999999713203 ⑦ Discussion of trial results The speed of convergence of this infinite series is fast. |
【45】 Approximation of 1 by the sum of infinite series | ||||||||||||||||||||||||||
① The following infinite series was used to approximate 1 , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of 1 ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"one18"」 , and press [Enter]. At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. n=20 S=0.9999999999999999952 ⑤ ExcelVBA program list Sub one18() Dim n, m As Double Dim s, t As Double Range("C2:C3").Select Selection.ClearContents Range("b2") = "n =" Range("b3") = "S =" t = 0 For m = 2 To 16 s = 1 For n = 1 To m DoEvents s= s * 1 / n Next n t = t + s * (m - 1) Range("c2") = m Range("c3") = t Next m End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 8 , and the column width of column C to 26. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 15. Make sure that cells B2 , B3 , C2 , and C3 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub one18()" in the program listing Execution → Click "Run Sub/Userform" The calculation result is displayed as follows. n=16 S=0.999999999999952 ⑦ Discussion of trial results The speed of convergence of this infinite series is fast. |
【46】 Approximation of 1 by the sum of infinite series | ||||||||||||||||||
① The following infinite series was used to approximate 1 , programed with "UBASIC" and "Excel VBA" respectively. ② Approximating infinite series of 1 ③ UBASIC program list
④ UBASIC program trial method and results Double-click "UB32.EXE". At the MS-DOS screen , type 「load"one19"」 , and press [Enter]. At the MS-DOS screen , type "run" , and press [Enter]. The calculation result is displayed as follows. n=100000 S=0.9999900000999962897 ⑤ ExcelVBA program list Sub one19() Dim n As Double Dim s As Double Range("C2:C3").Select Selection.ClearContents Range("b2") = "n =" Range("b3") = "S =" s = 0 For n = 1 To 100000 DoEvents s= s + 1 / (n * (n + 1)) Range("c2") = n Range("c3") = s Next n End Sub ⑥ ExcelVBA program trial method and results Set the column width of column B of the sheet to 8 , and the column width of column C to 26. Right-click on cell C3 , and select Format Cells. Set the display format classification to numeric , and set the number of digits after decimal point to 15. Make sure that cells B2 , B3 , C2 , and C3 are not covered by the form. Development → VisualBasic → Place the cursor on line "Sub one19()" in the program listing Execution → Click "Run Sub/Userform" The calculation result is displayed as follows. n=100000 S=0.99990000100012 ⑦ Discussion of trial results The speed of convergence of this infinite series is fast. |
Program language"UBASIC" | Program language "UBASIC" |
Clicking on the above program language "UBASIC" opens the UBASIC home download site.(If the site doesn't open , search
for "UBASIC" to find a downloadable site.) Select and click the "UBASIC" you want to download from the excutable files on the site. The following explains the case where the OS of the PC used is Windows Vista. ① Click the excutable file "DOS/V 32bit version (111K) 2000/10/8" on the site. ② Click [save] ③ Specify the save destination. ④ A compressed file "ub32v88f" is created in the save destination specified in ③. ⑤ When you double-click the compressed file "ub32v88f" in ④ , it will be self-decompressed and a folder "ub32v88f"will be created. |
Double-click the executable file "UBV32.EXE" in the folder "ub32v88f" created at [Download "UBASIC"] to start "UBASIC". |
Double-click file "pai.xlsm" , "e.xlsm" , and "one.xlsm"
in the folder "UbVbaSample" created at "Download the sample
program" to start "Excel". "pai.xlsm" is a program that approximates pi. "e.xlsm"is a program that approximates the base of natural logarithm."one.xlsm" is a program that approximates the natural number 1. Click [Development] → Click [VisualBasic] → Place the cursor on the Sub****() line in the list of programs you want to run → Execusion → Click "Run Sub/Userform" <Note> If the [Development] tab doesn't exit , follow the steps below to display it. Click [Office] → Click [Option of Excel] → Click "Show the Developer tab in the ribbon" in the basic options for using Excel. → Click [OK] |
You can download UBASIC and ExcelVBA sample programs for "Consider an approximate value of pi", "Consider an approximate value of base of natural logarithm" , and "Consider an approximate value of natural number 1" introduced on this website. If you click the "Sample Program Download" below , you can save the compressed file 「ubvbasample.lzh」 in LZH format on the desktop of your computer. When this compressed file "ubvbasample.lzh" is decompressed , a folder "UbVbaSample" is created. There are 46 UBASIC sample programs "~.UB" and 3 Excel VBA programs "~.xlsm" in the folder. Copy the UBASIC sample program "~.UB" to the folder where the UBASIC executable file "UBV32.EXE" is located. |
Sample Program Download | Sample Program Download |