bellyoshi

# πの計算

• R/O
• SSH
• HTTPS

## コミット

πの計算を行う。

### コミットメタ情報

リビジョン 6 (tree) 2014-09-12 21:37:29 bellyoshi

### 差分

--- CALCPI/CALCPI/LongNum.vb (revision 5)
+++ CALCPI/CALCPI/LongNum.vb (revision 6)
 @@ -4,7 +4,7 @@ 4 4 ''' 算出桁数 5 5 ''' 6 6 ''' 7 - Public Const L As Integer = 100 7 + Public Const L As Integer = 1000 8 8 9 9 ''' 10 10 ''' 配列サイズ
 @@ -52,6 +52,10 @@ 52 52 Next 53 53 Return sb.ToString 54 54 End Function 55 + 56 + Public Sub ladd(opeLongNum As LongNum) 57 + ladd(opeLongNum, Me) 58 + End Sub 55 59 56 60 Public Sub ladd(opeLongNum As LongNum, outLongNum As LongNum) 57 61 Dim b() As Integer = opeLongNum.array
 @@ -70,8 +74,10 @@ 70 74 71 75 End Sub 72 76 77 + Public Sub lsub(opeLongNum As LongNum) 78 + lsub(opeLongNum, Me) 79 + End Sub 73 80 74 - 75 81 Public Sub lsub(opeLongNum As LongNum, outLongNum As LongNum) 76 82 Dim b() As Integer = opeLongNum.array 77 83 Dim c() As Integer = outLongNum.array
 @@ -89,6 +95,10 @@ 89 95 90 96 End Sub 91 97 98 + Public Sub ldiv(ope As Integer) 99 + ldiv(ope, Me) 100 + End Sub 101 + 92 102 Public Sub ldiv(ByVal e As Integer, ByVal outLongNum As LongNum) 93 103 94 104 Dim d() As Integer = array
--- CALCPI/CALCPI/Module1.vb (revision 5)
+++ CALCPI/CALCPI/Module1.vb (revision 6)
 @@ -27,14 +27,14 @@ 27 27 q = New LongNum(0) 28 28 29 29 For k As Integer = 1 To LongNum.N 30 - a.ldiv(5 * 5, a) 31 - b.ldiv(239 * 239, b) 30 + a.ldiv(5 * 5) 31 + b.ldiv(239 * 239) 32 32 a.lsub(b, q) 33 33 q.ldiv(2 * k - 1, q) 34 34 If k Mod 2 = 0 Then 35 - s.lsub(q, s) 35 + s.lsub(q) 36 36 Else 37 - s.ladd(q, s) 37 + s.ladd(q) 38 38 End If 39 39 Next 40 40