long-decimal 0.00.17 → 0.00.18
Sign up to get free protection for your applications and to get access to all the features.
- data/README +10 -8
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/doc/classes/LongDecimal.html +1 -1
- data/doc/classes/LongDecimal.src/M000041.html +4 -0
- data/doc/classes/LongDecimal.src/M000042.html +1 -1
- data/doc/classes/LongDecimal.src/M000043.html +1 -1
- data/doc/classes/LongDecimal.src/M000044.html +1 -1
- data/doc/classes/LongDecimal.src/M000045.html +1 -1
- data/doc/classes/LongDecimal.src/M000046.html +1 -1
- data/doc/classes/LongDecimal.src/M000047.html +10 -6
- data/doc/classes/LongDecimal.src/M000048.html +1 -1
- data/doc/classes/LongDecimal.src/M000049.html +1 -1
- data/doc/classes/LongDecimal.src/M000050.html +1 -1
- data/doc/classes/LongDecimal.src/M000051.html +1 -1
- data/doc/classes/LongDecimal.src/M000052.html +1 -1
- data/doc/classes/LongDecimal.src/M000053.html +1 -1
- data/doc/classes/LongDecimal.src/M000054.html +1 -1
- data/doc/classes/LongDecimal.src/M000055.html +1 -1
- data/doc/classes/LongDecimal.src/M000056.html +1 -1
- data/doc/classes/LongDecimal.src/M000058.html +1 -1
- data/doc/classes/LongDecimal.src/M000059.html +1 -1
- data/doc/classes/LongDecimal.src/M000060.html +1 -1
- data/doc/classes/LongDecimal.src/M000061.html +1 -1
- data/doc/classes/LongDecimal.src/M000062.html +1 -1
- data/doc/classes/LongDecimal.src/M000063.html +1 -1
- data/doc/classes/LongDecimal.src/M000064.html +1 -1
- data/doc/classes/LongDecimal.src/M000065.html +1 -1
- data/doc/classes/LongDecimal.src/M000066.html +1 -1
- data/doc/classes/LongDecimal.src/M000067.html +1 -1
- data/doc/classes/LongDecimal.src/M000068.html +1 -1
- data/doc/classes/LongDecimal.src/M000069.html +1 -1
- data/doc/classes/LongDecimal.src/M000070.html +1 -1
- data/doc/classes/LongDecimal.src/M000071.html +1 -1
- data/doc/classes/LongDecimal.src/M000072.html +1 -1
- data/doc/classes/LongDecimal.src/M000073.html +1 -1
- data/doc/classes/LongDecimal.src/M000074.html +1 -1
- data/doc/classes/LongDecimal.src/M000075.html +1 -1
- data/doc/classes/LongDecimal.src/M000076.html +1 -1
- data/doc/classes/LongDecimal.src/M000077.html +1 -1
- data/doc/classes/LongDecimal.src/M000078.html +1 -1
- data/doc/classes/LongDecimal.src/M000079.html +1 -1
- data/doc/classes/LongDecimal.src/M000080.html +1 -1
- data/doc/classes/LongDecimal.src/M000081.html +1 -1
- data/doc/classes/LongDecimal.src/M000082.html +1 -1
- data/doc/classes/LongDecimal.src/M000083.html +1 -1
- data/doc/classes/LongDecimal.src/M000084.html +1 -1
- data/doc/classes/LongDecimal.src/M000085.html +1 -1
- data/doc/classes/LongDecimal.src/M000086.html +1 -1
- data/doc/classes/LongDecimal.src/M000087.html +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/M000094.html +1 -1
- data/doc/classes/LongDecimal.src/M000095.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/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 +5 -5
- data/doc/classes/LongDecimalRoundingMode/RoundingModeClass.src/M000138.html +22 -0
- data/doc/classes/LongMath.html +83 -55
- data/doc/classes/LongMath.src/M000113.html +1 -1
- data/doc/classes/LongMath.src/M000114.html +1 -1
- data/doc/classes/LongMath.src/M000115.html +1 -1
- data/doc/classes/LongMath.src/M000116.html +1 -1
- data/doc/classes/LongMath.src/M000117.html +1 -1
- data/doc/classes/LongMath.src/M000118.html +1 -1
- data/doc/classes/LongMath.src/M000119.html +1 -1
- data/doc/classes/LongMath.src/M000120.html +1 -1
- data/doc/classes/LongMath.src/M000121.html +1 -1
- data/doc/classes/LongMath.src/M000122.html +1 -1
- data/doc/classes/LongMath.src/M000123.html +1 -1
- data/doc/classes/LongMath.src/M000124.html +1 -1
- data/doc/classes/LongMath.src/M000125.html +1 -1
- data/doc/classes/LongMath.src/M000126.html +1 -1
- data/doc/classes/LongMath.src/M000127.html +2 -2
- data/doc/classes/LongMath.src/M000128.html +4 -13
- data/doc/classes/LongMath.src/M000129.html +4 -82
- data/doc/classes/LongMath.src/M000130.html +90 -5
- data/doc/classes/LongMath.src/M000131.html +8 -5
- data/doc/classes/LongMath.src/M000132.html +5 -15
- data/doc/classes/LongMath.src/M000133.html +14 -10
- data/doc/classes/LongMath.src/M000134.html +17 -149
- data/doc/classes/LongMath.src/M000135.html +206 -6
- data/doc/classes/LongMath.src/M000136.html +41 -22
- data/doc/classes/LongMath.src/M000137.html +58 -0
- data/doc/classes/Numeric.src/M000100.html +1 -1
- data/doc/classes/Rational.src/M000101.html +2 -2
- data/doc/created.rid +1 -1
- data/doc/files/lib/long-decimal_rb.html +188 -0
- 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 +25 -24
- data/lib/long-decimal.rb +156 -40
- data/test/testlongdecimal.rb +297 -6
- data/version.rb +1 -1
- metadata +5 -2
data/README
CHANGED
@@ -1,14 +1,10 @@
|
|
1
1
|
Version
|
2
2
|
-------
|
3
3
|
|
4
|
-
This version ($Name:
|
5
|
-
previous pre-alpha-0.
|
6
|
-
|
7
|
-
|
8
|
-
added. The documentation-tar.gz is no longer included, because the
|
9
|
-
documentation tar.gz-files of previous versions were hardly downloaded
|
10
|
-
and because it is possible to obtain the documentation from the
|
11
|
-
gem-file or from the source-file.
|
4
|
+
This version ($Name: PRE_ALPHA_0_18 $) is functionally identical with the
|
5
|
+
previous pre-alpha-0.17, but it has a bug fixed concerning exponential
|
6
|
+
functions with low precision after the decimal point, but a high
|
7
|
+
exponent resulting in many digits before the decimal point.
|
12
8
|
|
13
9
|
It could be observed that gem-installation, as described below, fails
|
14
10
|
on Windows 2000 with ruby 1.8.2, but works on Linux with ruby 1.8.4
|
@@ -23,6 +19,12 @@ within the next weeks, after having added some more tests and having
|
|
23
19
|
fixed potential bugs that these tests might reveal. I do not expect
|
24
20
|
the first alpha version to be much different from this version.
|
25
21
|
|
22
|
+
This software development effort is hosted on RubyForge (
|
23
|
+
http://rubyforge.org/ ) under the project name "long-decimal", to be
|
24
|
+
found directly with http://rubyforge.org/projects/long-decimal/ . So
|
25
|
+
you should feel encouraged to look if there is a newer version, when
|
26
|
+
you install long-decimal.
|
27
|
+
|
26
28
|
Install
|
27
29
|
-------
|
28
30
|
|
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.2 2006/03/18 08:32:02 bk1 Exp $
|
5
|
-
# CVS-Label: $Name:
|
5
|
+
# CVS-Label: $Name: PRE_ALPHA_0_18 $
|
6
6
|
# Author: $Author: bk1 $ (Karl Brodowsky)
|
7
7
|
#
|
8
8
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.00.
|
1
|
+
0.00.18
|
@@ -1238,7 +1238,7 @@ convert selt into BigDecimal
|
|
1238
1238
|
|
1239
1239
|
<div class="method-description">
|
1240
1240
|
<p>
|
1241
|
-
convert self into Float this works straitforward by dividing
|
1241
|
+
convert self into Float this works straitforward by dividing numerator by
|
1242
1242
|
power of 10 in float-arithmetic, in all cases where numerator and
|
1243
1243
|
denominator are within the ranges expressable as Floats. Goes via string
|
1244
1244
|
representation otherwise.
|
@@ -97,6 +97,10 @@
|
|
97
97
|
<span class="ruby-identifier">num_exp</span> = <span class="ruby-identifier">num_exp</span>.<span class="ruby-identifier">to_i</span>
|
98
98
|
<span class="ruby-identifier">iscale</span> = <span class="ruby-identifier">num_frac</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">num_exp</span>
|
99
99
|
<span class="ruby-identifier">scale</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">iscale</span>
|
100
|
+
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">scale</span> <span class="ruby-operator"><</span> <span class="ruby-value">0</span>)
|
101
|
+
<span class="ruby-identifier">num_frac</span> <span class="ruby-operator">+=</span> <span class="ruby-value str">"0"</span> <span class="ruby-operator">*</span> (<span class="ruby-operator">-</span><span class="ruby-identifier">scale</span>)
|
102
|
+
<span class="ruby-identifier">scale</span> = <span class="ruby-value">0</span>
|
103
|
+
<span class="ruby-keyword kw">end</span>
|
100
104
|
<span class="ruby-identifier">int_val</span> = (<span class="ruby-identifier">num_int</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">num_frac</span>).<span class="ruby-identifier">to_i</span>
|
101
105
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">negative</span> <span class="ruby-keyword kw">then</span>
|
102
106
|
<span class="ruby-identifier">int_val</span> = <span class="ruby-operator">-</span><span class="ruby-identifier">int_val</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 353</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">scale=</span>(<span class="ruby-identifier">s</span>)
|
15
15
|
<span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-node">"non integer arg \"#{s.inspect}\""</span> <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Integer</span>
|
16
16
|
<span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-node">"negative arg \"#{s.inspect}\""</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">s</span> <span class="ruby-operator"><</span> <span class="ruby-value">0</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 383</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">round_to_scale</span>(<span class="ruby-identifier">new_scale</span>, <span class="ruby-identifier">mode</span> = <span class="ruby-constant">ROUND_UNNECESSARY</span>)
|
15
15
|
|
16
16
|
<span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-node">"new_scale #{new_scale.inspect} must be integer"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">new_scale</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Integer</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 422</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>(<span class="ruby-identifier">shown_scale</span> = <span class="ruby-ivar">@scale</span>, <span class="ruby-identifier">mode</span> = <span class="ruby-constant">ROUND_UNNECESSARY</span>, <span class="ruby-identifier">base</span> = <span class="ruby-value">10</span>)
|
15
15
|
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">base</span> <span class="ruby-operator">==</span> <span class="ruby-value">10</span>) <span class="ruby-keyword kw">then</span>
|
16
16
|
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">shown_scale</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@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 445</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s_10</span>
|
15
15
|
<span class="ruby-identifier">to_s_internal</span>(<span class="ruby-value">10</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 452</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s_internal</span>(<span class="ruby-identifier">b</span>, <span class="ruby-identifier">sc</span>)
|
15
15
|
<span class="ruby-identifier">sg</span> = <span class="ruby-identifier">sgn</span>
|
16
16
|
<span class="ruby-identifier">i</span> = <span class="ruby-identifier">int_val</span>.<span class="ruby-identifier">abs</span>
|
@@ -10,28 +10,32 @@
|
|
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 477</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_f</span>
|
15
15
|
<span class="ruby-identifier">divisor</span> = <span class="ruby-identifier">denominator</span>
|
16
16
|
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">divisor</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>) <span class="ruby-keyword kw">then</span>
|
17
17
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">numerator</span>.<span class="ruby-identifier">to_f</span>
|
18
|
-
<span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">
|
18
|
+
<span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">numerator</span>.<span class="ruby-identifier">abs</span> <span class="ruby-operator"><=</span> <span class="ruby-constant">LongMath</span><span class="ruby-operator">::</span><span class="ruby-constant">MAX_FLOATABLE</span> <span class="ruby-keyword kw">then</span>
|
19
19
|
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">divisor</span>.<span class="ruby-identifier">abs</span> <span class="ruby-operator">></span> <span class="ruby-constant">LongMath</span><span class="ruby-operator">::</span><span class="ruby-constant">MAX_FLOATABLE</span>) <span class="ruby-keyword kw">then</span>
|
20
20
|
<span class="ruby-keyword kw">return</span> <span class="ruby-value">0</span><span class="ruby-value">.0</span>
|
21
21
|
<span class="ruby-keyword kw">else</span>
|
22
|
-
<span class="ruby-identifier">f</span> = <span class="ruby-identifier">
|
22
|
+
<span class="ruby-identifier">f</span> = <span class="ruby-identifier">numerator</span>.<span class="ruby-identifier">to_f</span>
|
23
23
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">f</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">divisor</span>
|
24
24
|
<span class="ruby-keyword kw">end</span>
|
25
25
|
<span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">numerator</span>.<span class="ruby-identifier">abs</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">divisor</span>
|
26
26
|
<span class="ruby-comment cmt"># self is between -1 and 1</span>
|
27
|
+
|
27
28
|
<span class="ruby-comment cmt"># factor = numerator.abs.div(LongMath::MAX_FLOATABLE)</span>
|
28
29
|
<span class="ruby-comment cmt"># digits = factor.to_ld.int_digits10</span>
|
29
30
|
<span class="ruby-comment cmt"># return LongDecimal(numerator.div(10**digits), scale -digits).to_f</span>
|
30
31
|
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">to_f</span>
|
31
32
|
<span class="ruby-keyword kw">else</span>
|
32
|
-
<span class="ruby-
|
33
|
-
<span class="ruby-
|
34
|
-
|
33
|
+
<span class="ruby-identifier">q</span> = <span class="ruby-identifier">numerator</span>.<span class="ruby-identifier">abs</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">divisor</span>
|
34
|
+
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">q</span>.<span class="ruby-identifier">abs</span> <span class="ruby-operator">></span> <span class="ruby-value">1000000000000000000000</span>)
|
35
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">q</span>.<span class="ruby-identifier">to_f</span>
|
36
|
+
<span class="ruby-keyword kw">else</span>
|
37
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">to_f</span>
|
38
|
+
<span class="ruby-keyword kw">end</span>
|
35
39
|
<span class="ruby-keyword kw">end</span>
|
36
40
|
<span class="ruby-keyword kw">end</span></pre>
|
37
41
|
</body>
|
@@ -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 511</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_i</span>
|
15
15
|
<span class="ruby-identifier">numerator</span>.<span class="ruby-identifier">div</span>(<span class="ruby-identifier">denominator</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 520</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_ld</span>(<span class="ruby-identifier">prec</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">mode</span> = <span class="ruby-constant">LongDecimal</span><span class="ruby-operator">::</span><span class="ruby-constant">ROUND_HALF_UP</span>)
|
15
15
|
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">prec</span>.<span class="ruby-identifier">nil?</span>)
|
16
16
|
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</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 531</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_bd</span>
|
15
15
|
<span class="ruby-comment cmt"># this operation is probably not used so heavily, so we can live with a</span>
|
16
16
|
<span class="ruby-comment cmt"># string as an intermediate step.</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 545</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">denominator</span>
|
15
15
|
<span class="ruby-value">10</span><span class="ruby-operator">**</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 567</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">int_digits2</span>
|
15
15
|
<span class="ruby-identifier">int_part</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">abs</span>.<span class="ruby-identifier">to_i</span>
|
16
16
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">int_part</span>.<span class="ruby-identifier">zero?</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 590</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">int_digits10</span>
|
15
15
|
<span class="ruby-identifier">int_part</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">abs</span>.<span class="ruby-identifier">to_i</span>
|
16
16
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">int_part</span>.<span class="ruby-identifier">zero?</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 627</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">equalize_scale</span>(<span class="ruby-identifier">other</span>)
|
15
15
|
<span class="ruby-identifier">o</span>, <span class="ruby-identifier">s</span> = <span class="ruby-identifier">coerce</span>(<span class="ruby-identifier">other</span>)
|
16
16
|
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">s</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 648</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">anti_equalize_scale</span>(<span class="ruby-identifier">other</span>)
|
15
15
|
<span class="ruby-identifier">o</span>, <span class="ruby-identifier">s</span> = <span class="ruby-identifier">coerce</span>(<span class="ruby-identifier">other</span>)
|
16
16
|
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">s</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 666</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">succ</span>
|
15
15
|
<span class="ruby-constant">LongDecimal</span>(<span class="ruby-identifier">int_val</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</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 677</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pred</span>
|
15
15
|
<span class="ruby-constant">LongDecimal</span>(<span class="ruby-identifier">int_val</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</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 684</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">inc!</span>
|
15
15
|
<span class="ruby-ivar">@int_val</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">denominator</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 691</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">dec!</span>
|
15
15
|
<span class="ruby-ivar">@int_val</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">denominator</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 698</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unit</span>
|
15
15
|
<span class="ruby-constant">LongDecimal</span>(<span class="ruby-value">1</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 706</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">-@</span>
|
15
15
|
<span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">zero?</span> <span class="ruby-keyword kw">then</span>
|
16
16
|
<span class="ruby-keyword kw">self</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 722</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-identifier">s</span>, <span class="ruby-identifier">o</span> = <span class="ruby-identifier">equalize_scale</span>(<span class="ruby-identifier">other</span>)
|
16
16
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">s</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 739</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-identifier">s</span>, <span class="ruby-identifier">o</span> = <span class="ruby-identifier">equalize_scale</span>(<span class="ruby-identifier">other</span>)
|
16
16
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">s</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 756</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-identifier">o</span>, <span class="ruby-identifier">s</span> = <span class="ruby-identifier">coerce</span>(<span class="ruby-identifier">other</span>)
|
16
16
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">s</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 769</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">divide</span>(<span class="ruby-identifier">other</span>, <span class="ruby-identifier">rounding_mode</span>)
|
15
15
|
<span class="ruby-identifier">divide_s</span>(<span class="ruby-identifier">other</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">rounding_mode</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 777</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">divide_s</span>(<span class="ruby-identifier">other</span>, <span class="ruby-identifier">new_scale</span>, <span class="ruby-identifier">rounding_mode</span>)
|
15
15
|
<span class="ruby-identifier">q</span> = <span class="ruby-keyword kw">self</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">other</span>
|
16
16
|
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">q</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Float</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 796</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rdiv</span>(<span class="ruby-identifier">other</span>)
|
15
15
|
<span class="ruby-identifier">q</span> = <span class="ruby-keyword kw">self</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">other</span>
|
16
16
|
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">q</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">LongDecimalQuot</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 815</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-identifier">o</span>, <span class="ruby-identifier">s</span> = <span class="ruby-identifier">coerce</span>(<span class="ruby-identifier">other</span>)
|
16
16
|
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">s</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 835</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-keyword kw">if</span> (<span class="ruby-identifier">other</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">LongDecimalBase</span>) <span class="ruby-operator">&&</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">is_int?</span> <span class="ruby-keyword kw">then</span>
|
16
16
|
<span class="ruby-identifier">other</span> = <span class="ruby-identifier">other</span>.<span class="ruby-identifier">to_i</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 858</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">divmod</span>(<span class="ruby-identifier">other</span>)
|
15
15
|
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">other</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Complex</span>) <span class="ruby-keyword kw">then</span>
|
16
16
|
<span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-value str">"divmod not supported for Complex"</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 869</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-identifier">q</span>, <span class="ruby-identifier">r</span> = <span class="ruby-identifier">divmod</span> <span class="ruby-identifier">other</span>
|
16
16
|
<span class="ruby-identifier">r</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 877</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-identifier">s</span>, <span class="ruby-identifier">o</span> = <span class="ruby-identifier">equalize_scale</span>(<span class="ruby-identifier">other</span>)
|
16
16
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">s</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 889</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-identifier">s</span>, <span class="ruby-identifier">o</span> = <span class="ruby-identifier">equalize_scale</span>(<span class="ruby-identifier">other</span>)
|
16
16
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">s</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 901</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-identifier">s</span>, <span class="ruby-identifier">o</span> = <span class="ruby-identifier">equalize_scale</span>(<span class="ruby-identifier">other</span>)
|
16
16
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">s</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 913</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">~</span>
|
15
15
|
<span class="ruby-constant">LongDecimal</span>(<span class="ruby-operator">~</span><span class="ruby-identifier">int_val</span>, <span class="ruby-identifier">scale</span>)
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|