• R/O
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javaandroidc++linuxc#objective-ccocoa誰得qtrubypythonbathyscaphephpgamewindowsguic翻訳omegattwitterframeworktestbtronarduinovb.net計画中(planning stage)directxpreviewerゲームエンジンdom

πの計算を行う。


コミットメタ情報

リビジョン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 @@
44 ''' 算出桁数
55 ''' </summary>
66 ''' <remarks></remarks>
7- Public Const L As Integer = 100
7+ Public Const L As Integer = 1000
88
99 ''' <summary>
1010 ''' 配列サイズ
@@ -52,6 +52,10 @@
5252 Next
5353 Return sb.ToString
5454 End Function
55+
56+ Public Sub ladd(opeLongNum As LongNum)
57+ ladd(opeLongNum, Me)
58+ End Sub
5559
5660 Public Sub ladd(opeLongNum As LongNum, outLongNum As LongNum)
5761 Dim b() As Integer = opeLongNum.array
@@ -70,8 +74,10 @@
7074
7175 End Sub
7276
77+ Public Sub lsub(opeLongNum As LongNum)
78+ lsub(opeLongNum, Me)
79+ End Sub
7380
74-
7581 Public Sub lsub(opeLongNum As LongNum, outLongNum As LongNum)
7682 Dim b() As Integer = opeLongNum.array
7783 Dim c() As Integer = outLongNum.array
@@ -89,6 +95,10 @@
8995
9096 End Sub
9197
98+ Public Sub ldiv(ope As Integer)
99+ ldiv(ope, Me)
100+ End Sub
101+
92102 Public Sub ldiv(ByVal e As Integer, ByVal outLongNum As LongNum)
93103
94104 Dim d() As Integer = array
--- CALCPI/CALCPI/Module1.vb (revision 5)
+++ CALCPI/CALCPI/Module1.vb (revision 6)
@@ -27,14 +27,14 @@
2727 q = New LongNum(0)
2828
2929 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)
3232 a.lsub(b, q)
3333 q.ldiv(2 * k - 1, q)
3434 If k Mod 2 = 0 Then
35- s.lsub(q, s)
35+ s.lsub(q)
3636 Else
37- s.ladd(q, s)
37+ s.ladd(q)
3838 End If
3939 Next
4040