long-decimal 0.00.21 → 0.00.22
Sign up to get free protection for your applications and to get access to all the features.
- data/README +23 -16
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/doc/classes/LongDecimal.html +343 -343
- data/doc/classes/LongDecimal.src/M000036.html +4 -4
- data/doc/classes/LongDecimal.src/M000037.html +4 -4
- data/doc/classes/LongDecimal.src/M000038.html +4 -4
- data/doc/classes/LongDecimal.src/M000039.html +4 -4
- data/doc/classes/LongDecimal.src/M000040.html +4 -6
- data/doc/classes/LongDecimal.src/M000041.html +4 -106
- data/doc/classes/LongDecimal.src/M000042.html +6 -21
- data/doc/classes/LongDecimal.src/M000043.html +105 -10
- data/doc/classes/LongDecimal.src/M000044.html +17 -23
- data/doc/classes/LongDecimal.src/M000045.html +10 -18
- data/doc/classes/LongDecimal.src/M000046.html +27 -4
- data/doc/classes/LongDecimal.src/M000047.html +17 -13
- data/doc/classes/LongDecimal.src/M000048.html +4 -28
- data/doc/classes/LongDecimal.src/M000049.html +15 -4
- data/doc/classes/LongDecimal.src/M000050.html +26 -6
- data/doc/classes/LongDecimal.src/M000051.html +4 -6
- data/doc/classes/LongDecimal.src/M000052.html +8 -4
- data/doc/classes/LongDecimal.src/M000053.html +6 -15
- data/doc/classes/LongDecimal.src/M000054.html +4 -7
- data/doc/classes/LongDecimal.src/M000055.html +15 -4
- data/doc/classes/LongDecimal.src/M000056.html +6 -14
- data/doc/classes/LongDecimal.src/M000057.html +4 -13
- data/doc/classes/LongDecimal.src/M000058.html +15 -4
- data/doc/classes/LongDecimal.src/M000059.html +13 -4
- data/doc/classes/LongDecimal.src/M000060.html +4 -4
- data/doc/classes/LongDecimal.src/M000062.html +4 -5
- data/doc/classes/LongDecimal.src/M000063.html +5 -4
- data/doc/classes/LongDecimal.src/M000064.html +5 -8
- data/doc/classes/LongDecimal.src/M000065.html +4 -9
- data/doc/classes/LongDecimal.src/M000066.html +6 -7
- data/doc/classes/LongDecimal.src/M000067.html +6 -6
- data/doc/classes/LongDecimal.src/M000068.html +9 -4
- data/doc/classes/LongDecimal.src/M000069.html +7 -13
- data/doc/classes/LongDecimal.src/M000070.html +4 -9
- data/doc/classes/LongDecimal.src/M000071.html +13 -7
- data/doc/classes/LongDecimal.src/M000072.html +7 -18
- data/doc/classes/LongDecimal.src/M000073.html +8 -7
- data/doc/classes/LongDecimal.src/M000074.html +20 -5
- data/doc/classes/LongDecimal.src/M000075.html +7 -8
- data/doc/classes/LongDecimal.src/M000076.html +5 -9
- data/doc/classes/LongDecimal.src/M000077.html +5 -5
- data/doc/classes/LongDecimal.src/M000078.html +9 -4
- data/doc/classes/LongDecimal.src/M000079.html +8 -6
- data/doc/classes/LongDecimal.src/M000080.html +4 -7
- data/doc/classes/LongDecimal.src/M000081.html +7 -4
- data/doc/classes/LongDecimal.src/M000082.html +7 -4
- data/doc/classes/LongDecimal.src/M000083.html +4 -9
- data/doc/classes/LongDecimal.src/M000084.html +4 -9
- data/doc/classes/LongDecimal.src/M000085.html +9 -5
- data/doc/classes/LongDecimal.src/M000086.html +7 -7
- data/doc/classes/LongDecimal.src/M000087.html +5 -4
- data/doc/classes/LongDecimal.src/M000088.html +9 -4
- data/doc/classes/LongDecimal.src/M000089.html +4 -4
- data/doc/classes/LongDecimal.src/M000090.html +4 -4
- data/doc/classes/LongDecimal.src/M000091.html +4 -59
- data/doc/classes/LongDecimal.src/M000092.html +4 -4
- data/doc/classes/LongDecimal.src/M000093.html +59 -4
- data/doc/classes/LongDecimal.src/M000094.html +4 -5
- data/doc/classes/LongDecimal.src/M000095.html +4 -4
- data/doc/classes/LongDecimal.src/M000098.html +5 -4
- data/doc/classes/LongDecimal.src/M000099.html +5 -4
- data/doc/classes/LongDecimal.src/M000100.html +4 -4
- data/doc/classes/LongDecimal.src/M000101.html +4 -4
- data/doc/classes/LongDecimalBase.html +53 -53
- data/doc/classes/LongDecimalBase.src/M000107.html +4 -4
- data/doc/classes/LongDecimalBase.src/M000108.html +4 -4
- data/doc/classes/LongDecimalBase.src/M000109.html +4 -4
- data/doc/classes/LongDecimalBase.src/M000110.html +4 -4
- data/doc/classes/LongDecimalBase.src/M000111.html +4 -5
- data/doc/classes/LongDecimalBase.src/M000112.html +9 -9
- data/doc/classes/LongDecimalBase.src/M000115.html +23 -0
- data/doc/classes/LongDecimalQuot.html +174 -133
- data/doc/classes/LongDecimalQuot.src/M000003.html +1 -1
- data/doc/classes/LongDecimalQuot.src/M000004.html +2 -1
- data/doc/classes/LongDecimalQuot.src/M000005.html +1 -1
- data/doc/classes/LongDecimalQuot.src/M000006.html +1 -1
- data/doc/classes/LongDecimalQuot.src/M000007.html +6 -5
- data/doc/classes/LongDecimalQuot.src/M000008.html +5 -4
- data/doc/classes/LongDecimalQuot.src/M000009.html +4 -4
- data/doc/classes/LongDecimalQuot.src/M000010.html +4 -4
- data/doc/classes/LongDecimalQuot.src/M000011.html +4 -4
- data/doc/classes/LongDecimalQuot.src/M000012.html +4 -4
- data/doc/classes/LongDecimalQuot.src/M000013.html +7 -4
- data/doc/classes/LongDecimalQuot.src/M000014.html +5 -8
- data/doc/classes/LongDecimalQuot.src/M000015.html +5 -9
- data/doc/classes/LongDecimalQuot.src/M000016.html +6 -7
- data/doc/classes/LongDecimalQuot.src/M000017.html +4 -4
- data/doc/classes/LongDecimalQuot.src/M000018.html +4 -4
- data/doc/classes/LongDecimalQuot.src/M000019.html +6 -18
- data/doc/classes/LongDecimalQuot.src/M000020.html +8 -7
- data/doc/classes/LongDecimalQuot.src/M000021.html +21 -5
- data/doc/classes/LongDecimalQuot.src/M000022.html +8 -4
- data/doc/classes/LongDecimalQuot.src/M000023.html +5 -96
- data/doc/classes/LongDecimalQuot.src/M000024.html +4 -38
- data/doc/classes/LongDecimalQuot.src/M000025.html +96 -4
- data/doc/classes/LongDecimalQuot.src/M000026.html +38 -4
- data/doc/classes/LongDecimalQuot.src/M000027.html +4 -4
- data/doc/classes/LongDecimalQuot.src/M000028.html +4 -4
- data/doc/classes/LongDecimalQuot.src/M000029.html +4 -4
- data/doc/classes/LongDecimalRoundingMode/RoundingModeClass.html +10 -10
- data/doc/classes/LongDecimalRoundingMode/RoundingModeClass.src/M000148.html +22 -0
- data/doc/classes/LongDecimalRoundingMode/RoundingModeClass.src/M000149.html +18 -0
- data/doc/classes/LongMath.html +159 -161
- data/doc/classes/LongMath.src/M000118.html +5 -4
- data/doc/classes/LongMath.src/M000119.html +4 -5
- data/doc/classes/LongMath.src/M000120.html +4 -4
- data/doc/classes/LongMath.src/M000121.html +5 -18
- data/doc/classes/LongMath.src/M000122.html +4 -18
- data/doc/classes/LongMath.src/M000123.html +18 -5
- data/doc/classes/LongMath.src/M000124.html +16 -27
- data/doc/classes/LongMath.src/M000125.html +4 -4
- data/doc/classes/LongMath.src/M000126.html +17 -45
- data/doc/classes/LongMath.src/M000127.html +5 -21
- data/doc/classes/LongMath.src/M000128.html +50 -29
- data/doc/classes/LongMath.src/M000129.html +21 -6
- data/doc/classes/LongMath.src/M000130.html +31 -28
- data/doc/classes/LongMath.src/M000131.html +6 -48
- data/doc/classes/LongMath.src/M000132.html +33 -8
- data/doc/classes/LongMath.src/M000133.html +51 -4
- data/doc/classes/LongMath.src/M000134.html +7 -4
- data/doc/classes/LongMath.src/M000135.html +4 -64
- data/doc/classes/LongMath.src/M000136.html +4 -43
- data/doc/classes/LongMath.src/M000137.html +64 -4
- data/doc/classes/LongMath.src/M000138.html +43 -4
- data/doc/classes/LongMath.src/M000139.html +4 -7
- data/doc/classes/LongMath.src/M000140.html +4 -20
- data/doc/classes/LongMath.src/M000141.html +4 -18
- data/doc/classes/LongMath.src/M000142.html +11 -34
- data/doc/classes/LongMath.src/M000143.html +13 -253
- data/doc/classes/LongMath.src/M000144.html +40 -16
- data/doc/classes/LongMath.src/M000145.html +227 -0
- data/doc/classes/LongMath.src/M000146.html +33 -0
- data/doc/classes/LongMath/CacheKey.html +6 -6
- data/doc/classes/LongMath/CacheKey.src/M000147.html +36 -0
- data/doc/classes/Numeric.html +10 -10
- data/doc/classes/Numeric.src/M000103.html +18 -0
- data/doc/classes/Rational.html +5 -5
- data/doc/classes/Rational.src/M000104.html +23 -0
- data/doc/created.rid +1 -1
- data/doc/files/lib/long-decimal_rb.src/M000001.html +1 -1
- data/doc/files/lib/long-decimal_rb.src/M000002.html +1 -1
- data/doc/fr_method_index.html +145 -143
- data/lib/long-decimal.rb +52 -71
- data/test/testlongdecimal.rb +218 -449
- data/test/testlongdeclib.rb +485 -0
- data/test/testrandom.rb +75 -0
- data/version.rb +1 -1
- metadata +12 -3
- data/doc/files/lib/long-decimal_rb.html +0 -189
@@ -5,15 +5,14 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title
|
8
|
+
<title>is_int? (LongDecimal)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-
|
15
|
-
<span class="ruby-
|
16
|
-
(<span class="ruby-identifier">other</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">LongDecimal</span>) <span class="ruby-operator">&&</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">int_val</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">int_val</span> <span class="ruby-operator">&&</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">scale</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">scale</span>
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 1129</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">is_int?</span>
|
15
|
+
<span class="ruby-identifier">scale</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">int_val</span> <span class="ruby-operator">%</span> <span class="ruby-value">10</span><span class="ruby-operator">**</span><span class="ruby-identifier">scale</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
|
17
16
|
<span class="ruby-keyword kw">end</span></pre>
|
18
17
|
</body>
|
19
18
|
</html>
|
@@ -5,14 +5,14 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title
|
8
|
+
<title>sgn (LongDecimal)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-
|
15
|
-
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 1139</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sgn</span>
|
15
|
+
<span class="ruby-identifier">int_val</span> <span class="ruby-operator"><=></span> <span class="ruby-value">0</span>
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
17
17
|
</body>
|
18
18
|
</html>
|
@@ -5,14 +5,15 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title
|
8
|
+
<title>== (LongDecimal)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
15
|
-
<span class="ruby-
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 1151</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">==</span>(<span class="ruby-identifier">other</span>)
|
15
|
+
<span class="ruby-comment cmt"># (other.kind_of? LongDecimal) && (self <=> other) == 0 && self.scale == other.scale</span>
|
16
|
+
(<span class="ruby-identifier">other</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">LongDecimal</span>) <span class="ruby-operator">&&</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">int_val</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">int_val</span> <span class="ruby-operator">&&</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">scale</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">scale</span>
|
16
17
|
<span class="ruby-keyword kw">end</span></pre>
|
17
18
|
</body>
|
18
19
|
</html>
|
@@ -5,14 +5,15 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title
|
8
|
+
<title>=== (LongDecimal)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
15
|
-
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 1161</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">===</span>(<span class="ruby-identifier">other</span>)
|
15
|
+
<span class="ruby-comment cmt"># (other.kind_of? LongDecimal) && self.int_val == other.int_val</span>
|
16
|
+
(<span class="ruby-keyword kw">self</span> <span class="ruby-operator"><=></span> <span class="ruby-identifier">other</span>).<span class="ruby-identifier">zero?</span>
|
16
17
|
<span class="ruby-keyword kw">end</span></pre>
|
17
18
|
</body>
|
18
19
|
</html>
|
@@ -5,14 +5,14 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>zero? (LongDecimal)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
15
|
-
<span class="ruby-identifier">int_val</span>.<span class="ruby-identifier">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 1170</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">zero?</span>
|
15
|
+
<span class="ruby-identifier">int_val</span>.<span class="ruby-identifier">zero?</span>
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
17
17
|
</body>
|
18
18
|
</html>
|
@@ -5,14 +5,14 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>one? (LongDecimal)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
15
|
-
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 1178</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">one?</span>
|
15
|
+
(<span class="ruby-keyword kw">self</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>).<span class="ruby-identifier">zero?</span>
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
17
17
|
</body>
|
18
18
|
</html>
|
@@ -110,17 +110,17 @@ href="LongDecimalQuot.html">LongDecimalQuot</a>
|
|
110
110
|
<h3 class="section-bar">Methods</h3>
|
111
111
|
|
112
112
|
<div class="name-list">
|
113
|
-
<a href="#
|
114
|
-
<a href="#
|
115
|
-
<a href="#
|
116
|
-
<a href="#
|
117
|
-
<a href="#
|
118
|
-
<a href="#
|
119
|
-
<a href="#
|
120
|
-
<a href="#
|
121
|
-
<a href="#
|
122
|
-
<a href="#
|
123
|
-
<a href="#
|
113
|
+
<a href="#M000110">+@</a>
|
114
|
+
<a href="#M000115"><=></a>
|
115
|
+
<a href="#M000114">abs2</a>
|
116
|
+
<a href="#M000109">dec</a>
|
117
|
+
<a href="#M000108">inc</a>
|
118
|
+
<a href="#M000113">inverse</a>
|
119
|
+
<a href="#M000112">reciprocal</a>
|
120
|
+
<a href="#M000117">scale_equal</a>
|
121
|
+
<a href="#M000116">scale_ufo</a>
|
122
|
+
<a href="#M000111">square</a>
|
123
|
+
<a href="#M000107">to_r</a>
|
124
124
|
</div>
|
125
125
|
</div>
|
126
126
|
|
@@ -149,12 +149,12 @@ href="LongDecimalQuot.html">LongDecimalQuot</a>
|
|
149
149
|
<div id="methods">
|
150
150
|
<h3 class="section-bar">Public Instance methods</h3>
|
151
151
|
|
152
|
-
<div id="method-
|
153
|
-
<a name="
|
152
|
+
<div id="method-M000110" class="method-detail">
|
153
|
+
<a name="M000110"></a>
|
154
154
|
|
155
155
|
<div class="method-heading">
|
156
|
-
<a href="LongDecimalBase.src/
|
157
|
-
onclick="popupCode('LongDecimalBase.src/
|
156
|
+
<a href="LongDecimalBase.src/M000110.html" target="Code" class="method-signature"
|
157
|
+
onclick="popupCode('LongDecimalBase.src/M000110.html');return false;">
|
158
158
|
<span class="method-name">+@</span><span class="method-args">()</span>
|
159
159
|
</a>
|
160
160
|
</div>
|
@@ -166,12 +166,12 @@ unary plus returns self
|
|
166
166
|
</div>
|
167
167
|
</div>
|
168
168
|
|
169
|
-
<div id="method-
|
170
|
-
<a name="
|
169
|
+
<div id="method-M000115" class="method-detail">
|
170
|
+
<a name="M000115"></a>
|
171
171
|
|
172
172
|
<div class="method-heading">
|
173
|
-
<a href="LongDecimalBase.src/
|
174
|
-
onclick="popupCode('LongDecimalBase.src/
|
173
|
+
<a href="LongDecimalBase.src/M000115.html" target="Code" class="method-signature"
|
174
|
+
onclick="popupCode('LongDecimalBase.src/M000115.html');return false;">
|
175
175
|
<span class="method-name"><=></span><span class="method-args">(other)</span>
|
176
176
|
</a>
|
177
177
|
</div>
|
@@ -193,8 +193,8 @@ of potentially zero digits after the decimal point.
|
|
193
193
|
</div>
|
194
194
|
</div>
|
195
195
|
|
196
|
-
<div id="method-
|
197
|
-
<a name="
|
196
|
+
<div id="method-M000114" class="method-detail">
|
197
|
+
<a name="M000114"></a>
|
198
198
|
|
199
199
|
<div class="method-heading">
|
200
200
|
<span class="method-name">abs2</span><span class="method-args">()</span>
|
@@ -202,17 +202,17 @@ of potentially zero digits after the decimal point.
|
|
202
202
|
|
203
203
|
<div class="method-description">
|
204
204
|
<p>
|
205
|
-
Alias for <a href="LongDecimalBase.html#
|
205
|
+
Alias for <a href="LongDecimalBase.html#M000111">square</a>
|
206
206
|
</p>
|
207
207
|
</div>
|
208
208
|
</div>
|
209
209
|
|
210
|
-
<div id="method-
|
211
|
-
<a name="
|
210
|
+
<div id="method-M000109" class="method-detail">
|
211
|
+
<a name="M000109"></a>
|
212
212
|
|
213
213
|
<div class="method-heading">
|
214
|
-
<a href="LongDecimalBase.src/
|
215
|
-
onclick="popupCode('LongDecimalBase.src/
|
214
|
+
<a href="LongDecimalBase.src/M000109.html" target="Code" class="method-signature"
|
215
|
+
onclick="popupCode('LongDecimalBase.src/M000109.html');return false;">
|
216
216
|
<span class="method-name">dec</span><span class="method-args">()</span>
|
217
217
|
</a>
|
218
218
|
</div>
|
@@ -224,12 +224,12 @@ self - 1
|
|
224
224
|
</div>
|
225
225
|
</div>
|
226
226
|
|
227
|
-
<div id="method-
|
228
|
-
<a name="
|
227
|
+
<div id="method-M000108" class="method-detail">
|
228
|
+
<a name="M000108"></a>
|
229
229
|
|
230
230
|
<div class="method-heading">
|
231
|
-
<a href="LongDecimalBase.src/
|
232
|
-
onclick="popupCode('LongDecimalBase.src/
|
231
|
+
<a href="LongDecimalBase.src/M000108.html" target="Code" class="method-signature"
|
232
|
+
onclick="popupCode('LongDecimalBase.src/M000108.html');return false;">
|
233
233
|
<span class="method-name">inc</span><span class="method-args">()</span>
|
234
234
|
</a>
|
235
235
|
</div>
|
@@ -241,8 +241,8 @@ self + 1
|
|
241
241
|
</div>
|
242
242
|
</div>
|
243
243
|
|
244
|
-
<div id="method-
|
245
|
-
<a name="
|
244
|
+
<div id="method-M000113" class="method-detail">
|
245
|
+
<a name="M000113"></a>
|
246
246
|
|
247
247
|
<div class="method-heading">
|
248
248
|
<span class="method-name">inverse</span><span class="method-args">()</span>
|
@@ -250,17 +250,17 @@ self + 1
|
|
250
250
|
|
251
251
|
<div class="method-description">
|
252
252
|
<p>
|
253
|
-
Alias for <a href="LongDecimalBase.html#
|
253
|
+
Alias for <a href="LongDecimalBase.html#M000112">reciprocal</a>
|
254
254
|
</p>
|
255
255
|
</div>
|
256
256
|
</div>
|
257
257
|
|
258
|
-
<div id="method-
|
259
|
-
<a name="
|
258
|
+
<div id="method-M000112" class="method-detail">
|
259
|
+
<a name="M000112"></a>
|
260
260
|
|
261
261
|
<div class="method-heading">
|
262
|
-
<a href="LongDecimalBase.src/
|
263
|
-
onclick="popupCode('LongDecimalBase.src/
|
262
|
+
<a href="LongDecimalBase.src/M000112.html" target="Code" class="method-signature"
|
263
|
+
onclick="popupCode('LongDecimalBase.src/M000112.html');return false;">
|
264
264
|
<span class="method-name">reciprocal</span><span class="method-args">()</span>
|
265
265
|
</a>
|
266
266
|
</div>
|
@@ -272,12 +272,12 @@ calculate the multiplicative inverse
|
|
272
272
|
</div>
|
273
273
|
</div>
|
274
274
|
|
275
|
-
<div id="method-
|
276
|
-
<a name="
|
275
|
+
<div id="method-M000117" class="method-detail">
|
276
|
+
<a name="M000117"></a>
|
277
277
|
|
278
278
|
<div class="method-heading">
|
279
|
-
<a href="LongDecimalBase.src/
|
280
|
-
onclick="popupCode('LongDecimalBase.src/
|
279
|
+
<a href="LongDecimalBase.src/M000117.html" target="Code" class="method-signature"
|
280
|
+
onclick="popupCode('LongDecimalBase.src/M000117.html');return false;">
|
281
281
|
<span class="method-name">scale_equal</span><span class="method-args">(other)</span>
|
282
282
|
</a>
|
283
283
|
</div>
|
@@ -287,12 +287,12 @@ calculate the multiplicative inverse
|
|
287
287
|
</div>
|
288
288
|
</div>
|
289
289
|
|
290
|
-
<div id="method-
|
291
|
-
<a name="
|
290
|
+
<div id="method-M000116" class="method-detail">
|
291
|
+
<a name="M000116"></a>
|
292
292
|
|
293
293
|
<div class="method-heading">
|
294
|
-
<a href="LongDecimalBase.src/
|
295
|
-
onclick="popupCode('LongDecimalBase.src/
|
294
|
+
<a href="LongDecimalBase.src/M000116.html" target="Code" class="method-signature"
|
295
|
+
onclick="popupCode('LongDecimalBase.src/M000116.html');return false;">
|
296
296
|
<span class="method-name">scale_ufo</span><span class="method-args">(other)</span>
|
297
297
|
</a>
|
298
298
|
</div>
|
@@ -304,12 +304,12 @@ calculate the multiplicative inverse
|
|
304
304
|
</div>
|
305
305
|
</div>
|
306
306
|
|
307
|
-
<div id="method-
|
308
|
-
<a name="
|
307
|
+
<div id="method-M000111" class="method-detail">
|
308
|
+
<a name="M000111"></a>
|
309
309
|
|
310
310
|
<div class="method-heading">
|
311
|
-
<a href="LongDecimalBase.src/
|
312
|
-
onclick="popupCode('LongDecimalBase.src/
|
311
|
+
<a href="LongDecimalBase.src/M000111.html" target="Code" class="method-signature"
|
312
|
+
onclick="popupCode('LongDecimalBase.src/M000111.html');return false;">
|
313
313
|
<span class="method-name">square</span><span class="method-args">()</span>
|
314
314
|
</a>
|
315
315
|
</div>
|
@@ -321,12 +321,12 @@ calculate the square of self
|
|
321
321
|
</div>
|
322
322
|
</div>
|
323
323
|
|
324
|
-
<div id="method-
|
325
|
-
<a name="
|
324
|
+
<div id="method-M000107" class="method-detail">
|
325
|
+
<a name="M000107"></a>
|
326
326
|
|
327
327
|
<div class="method-heading">
|
328
|
-
<a href="LongDecimalBase.src/
|
329
|
-
onclick="popupCode('LongDecimalBase.src/
|
328
|
+
<a href="LongDecimalBase.src/M000107.html" target="Code" class="method-signature"
|
329
|
+
onclick="popupCode('LongDecimalBase.src/M000107.html');return false;">
|
330
330
|
<span class="method-name">to_r</span><span class="method-args">()</span>
|
331
331
|
</a>
|
332
332
|
</div>
|
@@ -5,14 +5,14 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>to_r (LongDecimalBase)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
15
|
-
<span class="ruby-
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 75</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_r</span>
|
15
|
+
<span class="ruby-constant">Rational</span>(<span class="ruby-identifier">numerator</span>, <span class="ruby-identifier">denominator</span>)
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
17
17
|
</body>
|
18
18
|
</html>
|
@@ -5,14 +5,14 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title
|
8
|
+
<title>inc (LongDecimalBase)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-
|
15
|
-
<span class="ruby-keyword kw">self</span>
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 82</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">inc</span>
|
15
|
+
<span class="ruby-keyword kw">self</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
17
17
|
</body>
|
18
18
|
</html>
|
@@ -5,14 +5,14 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>dec (LongDecimalBase)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
15
|
-
<span class="ruby-keyword kw">self</span> <span class="ruby-operator"
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 89</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">dec</span>
|
15
|
+
<span class="ruby-keyword kw">self</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
17
17
|
</body>
|
18
18
|
</html>
|
@@ -5,14 +5,14 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title
|
8
|
+
<title>+@ (LongDecimalBase)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-
|
15
|
-
<span class="ruby-
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 96</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">+@</span>
|
15
|
+
<span class="ruby-keyword kw">self</span>
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
17
17
|
</body>
|
18
18
|
</html>
|
@@ -5,15 +5,14 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>square (LongDecimalBase)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
15
|
-
<span class="ruby-
|
16
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">scale</span> <span class="ruby-operator"><=></span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">scale</span>
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 103</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">square</span>
|
15
|
+
<span class="ruby-keyword kw">self</span> <span class="ruby-operator">*</span> <span class="ruby-keyword kw">self</span>
|
17
16
|
<span class="ruby-keyword kw">end</span></pre>
|
18
17
|
</body>
|
19
18
|
</html>
|
@@ -5,19 +5,19 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title
|
8
|
+
<title>reciprocal (LongDecimalBase)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-
|
15
|
-
<span class="ruby-identifier">
|
16
|
-
<span class="ruby-
|
17
|
-
|
18
|
-
<span class="ruby-keyword kw">
|
19
|
-
|
20
|
-
<span class="ruby-
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 110</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reciprocal</span>
|
15
|
+
<span class="ruby-identifier">sx</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">scale</span>
|
16
|
+
<span class="ruby-identifier">dx</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">sint_digits10</span>
|
17
|
+
<span class="ruby-identifier">new_scale</span> = [ <span class="ruby-value">0</span>, <span class="ruby-value">2</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">dx</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">sx</span> <span class="ruby-operator">-</span> <span class="ruby-value">2</span>].<span class="ruby-identifier">max</span>
|
18
|
+
<span class="ruby-identifier">result</span> = <span class="ruby-value">1</span> <span class="ruby-operator">/</span> <span class="ruby-keyword kw">self</span>
|
19
|
+
<span class="ruby-identifier">result</span>.<span class="ruby-identifier">scale</span> = <span class="ruby-identifier">new_scale</span>
|
20
|
+
<span class="ruby-identifier">result</span>
|
21
21
|
<span class="ruby-keyword kw">end</span></pre>
|
22
22
|
</body>
|
23
23
|
</html>
|