long-decimal 0.00.20 → 0.00.21
Sign up to get free protection for your applications and to get access to all the features.
- data/README +32 -31
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/doc/classes/LongDecimal.src/M000088.html +1 -1
- data/doc/classes/LongDecimal.src/M000089.html +1 -1
- data/doc/classes/LongDecimal.src/M000090.html +1 -1
- data/doc/classes/LongDecimal.src/M000091.html +1 -1
- data/doc/classes/LongDecimal.src/M000092.html +1 -1
- data/doc/classes/LongDecimal.src/M000093.html +1 -1
- data/doc/classes/LongDecimal.src/M000096.html +1 -1
- data/doc/classes/LongDecimal.src/M000097.html +1 -1
- data/doc/classes/LongDecimal.src/M000098.html +1 -1
- data/doc/classes/LongDecimal.src/M000099.html +1 -1
- data/doc/classes/LongDecimal.src/M000100.html +1 -1
- data/doc/classes/LongDecimal.src/M000101.html +1 -1
- data/doc/classes/LongDecimalBase.html +53 -53
- data/doc/classes/LongDecimalBase.src/M000105.html +4 -4
- data/doc/classes/LongDecimalBase.src/M000106.html +4 -4
- 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 -9
- data/doc/classes/LongDecimalBase.src/M000113.html +9 -5
- data/doc/classes/LongDecimalBase.src/M000114.html +5 -4
- data/doc/classes/LongDecimalQuot.src/M000003.html +1 -1
- data/doc/classes/LongDecimalQuot.src/M000004.html +1 -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 +1 -1
- data/doc/classes/LongDecimalQuot.src/M000008.html +1 -1
- data/doc/classes/LongDecimalQuot.src/M000009.html +1 -1
- data/doc/classes/LongDecimalQuot.src/M000010.html +1 -1
- data/doc/classes/LongDecimalQuot.src/M000011.html +1 -1
- data/doc/classes/LongDecimalQuot.src/M000012.html +1 -1
- data/doc/classes/LongDecimalQuot.src/M000013.html +1 -1
- data/doc/classes/LongDecimalQuot.src/M000014.html +1 -1
- data/doc/classes/LongDecimalQuot.src/M000015.html +1 -1
- data/doc/classes/LongDecimalQuot.src/M000016.html +1 -1
- data/doc/classes/LongDecimalQuot.src/M000017.html +1 -1
- data/doc/classes/LongDecimalQuot.src/M000018.html +1 -1
- data/doc/classes/LongDecimalQuot.src/M000019.html +1 -1
- data/doc/classes/LongDecimalQuot.src/M000020.html +1 -1
- data/doc/classes/LongDecimalQuot.src/M000021.html +1 -1
- data/doc/classes/LongDecimalQuot.src/M000022.html +1 -1
- data/doc/classes/LongDecimalQuot.src/M000023.html +1 -1
- data/doc/classes/LongDecimalQuot.src/M000024.html +1 -1
- data/doc/classes/LongDecimalQuot.src/M000025.html +1 -1
- data/doc/classes/LongDecimalQuot.src/M000026.html +1 -1
- data/doc/classes/LongDecimalQuot.src/M000027.html +1 -1
- data/doc/classes/LongDecimalQuot.src/M000028.html +1 -1
- data/doc/classes/LongDecimalQuot.src/M000029.html +1 -1
- data/doc/classes/LongDecimalQuot.src/M000032.html +1 -1
- data/doc/classes/LongDecimalQuot.src/M000033.html +1 -1
- data/doc/classes/LongDecimalRoundingMode/RoundingModeClass.html +10 -10
- data/doc/classes/LongMath.html +170 -151
- data/doc/classes/LongMath.src/M000116.html +5 -4
- data/doc/classes/LongMath.src/M000117.html +4 -4
- data/doc/classes/LongMath.src/M000118.html +4 -5
- data/doc/classes/LongMath.src/M000119.html +5 -4
- data/doc/classes/LongMath.src/M000120.html +4 -18
- data/doc/classes/LongMath.src/M000121.html +14 -14
- data/doc/classes/LongMath.src/M000122.html +18 -5
- data/doc/classes/LongMath.src/M000123.html +5 -29
- data/doc/classes/LongMath.src/M000124.html +29 -5
- data/doc/classes/LongMath.src/M000125.html +5 -56
- data/doc/classes/LongMath.src/M000126.html +55 -19
- data/doc/classes/LongMath.src/M000127.html +20 -35
- data/doc/classes/LongMath.src/M000128.html +36 -6
- data/doc/classes/LongMath.src/M000129.html +6 -33
- data/doc/classes/LongMath.src/M000130.html +26 -41
- data/doc/classes/LongMath.src/M000131.html +46 -6
- data/doc/classes/LongMath.src/M000132.html +8 -4
- data/doc/classes/LongMath.src/M000133.html +4 -4
- data/doc/classes/LongMath.src/M000134.html +4 -64
- data/doc/classes/LongMath.src/M000135.html +59 -38
- data/doc/classes/LongMath.src/M000136.html +41 -8
- data/doc/classes/LongMath.src/M000137.html +4 -7
- data/doc/classes/LongMath.src/M000138.html +4 -20
- data/doc/classes/LongMath.src/M000139.html +4 -17
- data/doc/classes/LongMath.src/M000140.html +11 -34
- data/doc/classes/LongMath.src/M000141.html +14 -199
- data/doc/classes/LongMath.src/M000142.html +40 -16
- data/doc/classes/LongMath.src/M000143.html +211 -8
- data/doc/classes/LongMath.src/M000144.html +16 -41
- data/doc/classes/LongMath/CacheKey.html +5 -5
- data/doc/classes/Numeric.html +18 -0
- data/doc/classes/Numeric.src/M000102.html +1 -1
- data/doc/classes/Rational.html +5 -5
- data/doc/created.rid +1 -1
- data/doc/files/lib/long-decimal_rb.html +2 -2
- 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 +61 -59
- data/lib/long-decimal.rb +173 -80
- data/test/testlongdecimal.rb +258 -58
- metadata +2 -2
data/README
CHANGED
@@ -1,26 +1,24 @@
|
|
1
1
|
Version
|
2
2
|
-------
|
3
3
|
|
4
|
-
This version ($Name:
|
5
|
-
previous pre-alpha-0.
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
fixed potential bugs that these tests might reveal. I do not expect
|
23
|
-
the first alpha version to be much different from this version.
|
4
|
+
This version ($Name: PRE_ALPHA_0_21 $) is functionally identical with the
|
5
|
+
previous pre-alpha-0.20. Improvements are for speed, because the
|
6
|
+
convergence acceleration for logarithm is done in a more efficient
|
7
|
+
way. This influences methods log2, log10 and power of LongMath.
|
8
|
+
|
9
|
+
There are no known bugs and this version can be considered complete in
|
10
|
+
terms of functionality. This version is still a pre-alpha-version,
|
11
|
+
but it is expected to move it to alpha within the next weeks, after
|
12
|
+
having added some more tests and having fixed potential bugs that
|
13
|
+
these tests might reveal. The first alpha version is not expected to
|
14
|
+
be much different from this version. This version should already be
|
15
|
+
usable. Operations +, -, *, / and sqrt should be working properly.
|
16
|
+
Even log, exp and power should be fine, but they might have some
|
17
|
+
issues in terms of precision of the last digits provided or in terms
|
18
|
+
of speed. It would be a good idea to do some mathematical analysis on
|
19
|
+
how many digits are needed internally to guarantee the correctness of
|
20
|
+
the digits that are provided. Testing as well as rough analysis
|
21
|
+
indicate that this might be correct already.
|
24
22
|
|
25
23
|
This software development effort is hosted on RubyForge (
|
26
24
|
http://rubyforge.org/ ) under the project name "long-decimal", to be
|
@@ -31,17 +29,20 @@ you install long-decimal.
|
|
31
29
|
Test
|
32
30
|
----
|
33
31
|
|
34
|
-
|
35
|
-
correctness of this library
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
32
|
+
Some runit tests have been included. They give some indication of the
|
33
|
+
correctness of this library and allow changes to be checked in order
|
34
|
+
to make sure that what was running before would still work afterwards.
|
35
|
+
Tests for a library as complex as long-decimal can never be
|
36
|
+
exhaustive, but they give a good indication that methods are working
|
37
|
+
correctly. About 90% of the tests that will be eventually needed are
|
38
|
+
already present. As a policy a release is not created unless all
|
39
|
+
tests succeed. Running the tests can take a few minutes, depending on
|
40
|
+
your machine. It is about 15 minutes on my machine (1300 MHz).
|
41
|
+
Whatever is gained by making the software run faster is used up again
|
42
|
+
by adding more tests. This is the result of the test:
|
43
|
+
|
44
|
+
Finished in 869.98785 seconds.
|
45
|
+
102 tests, 44345 assertions, 0 failures, 0 errors
|
45
46
|
|
46
47
|
Install
|
47
48
|
-------
|
data/Rakefile
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
# Rakefile for long-decimal project
|
3
3
|
#
|
4
4
|
# CVS-ID: $Header: /var/cvs/long-decimal/long-decimal/Rakefile,v 1.3 2006/04/01 08:52:06 bk1 Exp $
|
5
|
-
# CVS-Label: $Name:
|
5
|
+
# CVS-Label: $Name: PRE_ALPHA_0_21 $
|
6
6
|
# Author: $Author: bk1 $ (Karl Brodowsky)
|
7
7
|
#
|
8
8
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.00.
|
1
|
+
0.00.21
|
@@ -12,7 +12,7 @@
|
|
12
12
|
<body class="standalone-code">
|
13
13
|
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 1036</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sqrt</span>(<span class="ruby-identifier">new_scale</span>, <span class="ruby-identifier">rounding_mode</span>)
|
15
|
-
<span class="ruby-identifier">
|
15
|
+
<span class="ruby-constant">LongMath</span>.<span class="ruby-identifier">sqrt</span>(<span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">new_scale</span>, <span class="ruby-identifier">rounding_mode</span>)
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
17
17
|
</body>
|
18
18
|
</html>
|
@@ -12,7 +12,7 @@
|
|
12
12
|
<body class="standalone-code">
|
13
13
|
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 1046</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sqrt_with_remainder</span>(<span class="ruby-identifier">new_scale</span>)
|
15
|
-
<span class="ruby-
|
15
|
+
<span class="ruby-constant">LongMath</span>.<span class="ruby-identifier">sqrt_with_remainder</span>(<span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">new_scale</span>)
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
17
17
|
</body>
|
18
18
|
</html>
|
@@ -10,7 +10,7 @@
|
|
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
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 1053</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">abs</span>
|
15
15
|
<span class="ruby-constant">LongDecimal</span>(<span class="ruby-identifier">int_val</span>.<span class="ruby-identifier">abs</span>, <span class="ruby-identifier">scale</span>)
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
@@ -10,7 +10,7 @@
|
|
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
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 1062</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">coerce</span>(<span class="ruby-identifier">other</span>)
|
15
15
|
|
16
16
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">LongDecimal</span> <span class="ruby-keyword kw">then</span>
|
@@ -10,7 +10,7 @@
|
|
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
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 1124</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">is_int?</span>
|
15
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>
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
@@ -10,7 +10,7 @@
|
|
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
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 1134</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sgn</span>
|
15
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>
|
@@ -10,7 +10,7 @@
|
|
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
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 1146</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">==</span>(<span class="ruby-identifier">other</span>)
|
15
15
|
<span class="ruby-comment cmt"># (other.kind_of? LongDecimal) && (self <=> other) == 0 && self.scale == other.scale</span>
|
16
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>
|
@@ -10,7 +10,7 @@
|
|
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
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 1156</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">===</span>(<span class="ruby-identifier">other</span>)
|
15
15
|
<span class="ruby-comment cmt"># (other.kind_of? LongDecimal) && self.int_val == other.int_val</span>
|
16
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>
|
@@ -10,7 +10,7 @@
|
|
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
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 1165</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">zero?</span>
|
15
15
|
<span class="ruby-identifier">int_val</span>.<span class="ruby-identifier">zero?</span>
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
@@ -10,7 +10,7 @@
|
|
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
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 1173</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">one?</span>
|
15
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>
|
@@ -10,7 +10,7 @@
|
|
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
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 1180</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">hash</span>
|
15
15
|
<span class="ruby-identifier">int_val</span>.<span class="ruby-identifier">hash</span> <span class="ruby-operator">^</span> <span class="ruby-identifier">scale</span>.<span class="ruby-identifier">hash</span>
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
@@ -10,7 +10,7 @@
|
|
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
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 1187</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">inspect</span>
|
15
15
|
<span class="ruby-identifier">sprintf</span>(<span class="ruby-value str">"LongDecimal(%s, %s)"</span>, <span class="ruby-identifier">int_val</span>.<span class="ruby-identifier">inspect</span>, <span class="ruby-identifier">scale</span>.<span class="ruby-identifier">inspect</span>)
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
@@ -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="#M000108">+@</a>
|
114
|
+
<a href="#M000113"><=></a>
|
115
|
+
<a href="#M000112">abs2</a>
|
116
|
+
<a href="#M000107">dec</a>
|
117
|
+
<a href="#M000106">inc</a>
|
118
|
+
<a href="#M000111">inverse</a>
|
119
|
+
<a href="#M000110">reciprocal</a>
|
120
|
+
<a href="#M000115">scale_equal</a>
|
121
|
+
<a href="#M000114">scale_ufo</a>
|
122
|
+
<a href="#M000109">square</a>
|
123
|
+
<a href="#M000105">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-M000108" class="method-detail">
|
153
|
+
<a name="M000108"></a>
|
154
154
|
|
155
155
|
<div class="method-heading">
|
156
|
-
<a href="LongDecimalBase.src/
|
157
|
-
onclick="popupCode('LongDecimalBase.src/
|
156
|
+
<a href="LongDecimalBase.src/M000108.html" target="Code" class="method-signature"
|
157
|
+
onclick="popupCode('LongDecimalBase.src/M000108.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-M000113" class="method-detail">
|
170
|
+
<a name="M000113"></a>
|
171
171
|
|
172
172
|
<div class="method-heading">
|
173
|
-
<a href="LongDecimalBase.src/
|
174
|
-
onclick="popupCode('LongDecimalBase.src/
|
173
|
+
<a href="LongDecimalBase.src/M000113.html" target="Code" class="method-signature"
|
174
|
+
onclick="popupCode('LongDecimalBase.src/M000113.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-M000112" class="method-detail">
|
197
|
+
<a name="M000112"></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#M000109">square</a>
|
206
206
|
</p>
|
207
207
|
</div>
|
208
208
|
</div>
|
209
209
|
|
210
|
-
<div id="method-
|
211
|
-
<a name="
|
210
|
+
<div id="method-M000107" class="method-detail">
|
211
|
+
<a name="M000107"></a>
|
212
212
|
|
213
213
|
<div class="method-heading">
|
214
|
-
<a href="LongDecimalBase.src/
|
215
|
-
onclick="popupCode('LongDecimalBase.src/
|
214
|
+
<a href="LongDecimalBase.src/M000107.html" target="Code" class="method-signature"
|
215
|
+
onclick="popupCode('LongDecimalBase.src/M000107.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-M000106" class="method-detail">
|
228
|
+
<a name="M000106"></a>
|
229
229
|
|
230
230
|
<div class="method-heading">
|
231
|
-
<a href="LongDecimalBase.src/
|
232
|
-
onclick="popupCode('LongDecimalBase.src/
|
231
|
+
<a href="LongDecimalBase.src/M000106.html" target="Code" class="method-signature"
|
232
|
+
onclick="popupCode('LongDecimalBase.src/M000106.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-M000111" class="method-detail">
|
245
|
+
<a name="M000111"></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#M000110">reciprocal</a>
|
254
254
|
</p>
|
255
255
|
</div>
|
256
256
|
</div>
|
257
257
|
|
258
|
-
<div id="method-
|
259
|
-
<a name="
|
258
|
+
<div id="method-M000110" class="method-detail">
|
259
|
+
<a name="M000110"></a>
|
260
260
|
|
261
261
|
<div class="method-heading">
|
262
|
-
<a href="LongDecimalBase.src/
|
263
|
-
onclick="popupCode('LongDecimalBase.src/
|
262
|
+
<a href="LongDecimalBase.src/M000110.html" target="Code" class="method-signature"
|
263
|
+
onclick="popupCode('LongDecimalBase.src/M000110.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-M000115" class="method-detail">
|
276
|
+
<a name="M000115"></a>
|
277
277
|
|
278
278
|
<div class="method-heading">
|
279
|
-
<a href="LongDecimalBase.src/
|
280
|
-
onclick="popupCode('LongDecimalBase.src/
|
279
|
+
<a href="LongDecimalBase.src/M000115.html" target="Code" class="method-signature"
|
280
|
+
onclick="popupCode('LongDecimalBase.src/M000115.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-M000114" class="method-detail">
|
291
|
+
<a name="M000114"></a>
|
292
292
|
|
293
293
|
<div class="method-heading">
|
294
|
-
<a href="LongDecimalBase.src/
|
295
|
-
onclick="popupCode('LongDecimalBase.src/
|
294
|
+
<a href="LongDecimalBase.src/M000114.html" target="Code" class="method-signature"
|
295
|
+
onclick="popupCode('LongDecimalBase.src/M000114.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-M000109" class="method-detail">
|
308
|
+
<a name="M000109"></a>
|
309
309
|
|
310
310
|
<div class="method-heading">
|
311
|
-
<a href="LongDecimalBase.src/
|
312
|
-
onclick="popupCode('LongDecimalBase.src/
|
311
|
+
<a href="LongDecimalBase.src/M000109.html" target="Code" class="method-signature"
|
312
|
+
onclick="popupCode('LongDecimalBase.src/M000109.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-M000105" class="method-detail">
|
325
|
+
<a name="M000105"></a>
|
326
326
|
|
327
327
|
<div class="method-heading">
|
328
|
-
<a href="LongDecimalBase.src/
|
329
|
-
onclick="popupCode('LongDecimalBase.src/
|
328
|
+
<a href="LongDecimalBase.src/M000105.html" target="Code" class="method-signature"
|
329
|
+
onclick="popupCode('LongDecimalBase.src/M000105.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-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 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>
|