long-decimal 0.01.00 → 0.01.01
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README +6 -3
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/doc/classes/LongDecimal.html +207 -189
- data/doc/classes/LongDecimal.src/M000036.html +1 -1
- data/doc/classes/LongDecimal.src/M000037.html +1 -1
- data/doc/classes/LongDecimal.src/M000038.html +1 -1
- data/doc/classes/LongDecimal.src/M000039.html +1 -1
- data/doc/classes/LongDecimal.src/M000040.html +1 -1
- data/doc/classes/LongDecimal.src/M000041.html +1 -1
- 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 +1 -1
- 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 +15 -2
- data/doc/classes/LongDecimal.src/M000051.html +1 -1
- data/doc/classes/LongDecimal.src/M000052.html +2 -2
- 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/M000057.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/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 +4 -8
- data/doc/classes/LongDecimal.src/M000067.html +6 -7
- data/doc/classes/LongDecimal.src/M000068.html +5 -5
- data/doc/classes/LongDecimal.src/M000069.html +6 -6
- data/doc/classes/LongDecimal.src/M000070.html +9 -4
- data/doc/classes/LongDecimal.src/M000071.html +4 -19
- data/doc/classes/LongDecimal.src/M000072.html +15 -5
- data/doc/classes/LongDecimal.src/M000073.html +7 -7
- data/doc/classes/LongDecimal.src/M000074.html +7 -18
- data/doc/classes/LongDecimal.src/M000075.html +20 -7
- data/doc/classes/LongDecimal.src/M000076.html +8 -5
- data/doc/classes/LongDecimal.src/M000077.html +5 -9
- data/doc/classes/LongDecimal.src/M000078.html +5 -5
- data/doc/classes/LongDecimal.src/M000079.html +5 -5
- data/doc/classes/LongDecimal.src/M000080.html +9 -4
- data/doc/classes/LongDecimal.src/M000081.html +4 -7
- data/doc/classes/LongDecimal.src/M000082.html +4 -4
- data/doc/classes/LongDecimal.src/M000083.html +7 -4
- data/doc/classes/LongDecimal.src/M000084.html +4 -4
- data/doc/classes/LongDecimal.src/M000085.html +4 -9
- data/doc/classes/LongDecimal.src/M000086.html +6 -6
- data/doc/classes/LongDecimal.src/M000087.html +9 -5
- data/doc/classes/LongDecimal.src/M000088.html +4 -8
- data/doc/classes/LongDecimal.src/M000089.html +9 -4
- data/doc/classes/LongDecimal.src/M000090.html +4 -4
- data/doc/classes/LongDecimal.src/M000091.html +4 -4
- data/doc/classes/LongDecimal.src/M000092.html +4 -4
- data/doc/classes/LongDecimal.src/M000093.html +4 -59
- data/doc/classes/LongDecimal.src/M000094.html +59 -4
- data/doc/classes/LongDecimal.src/M000095.html +4 -4
- data/doc/classes/LongDecimal.src/M000096.html +4 -5
- data/doc/classes/LongDecimal.src/M000099.html +5 -5
- data/doc/classes/LongDecimal.src/M000100.html +5 -4
- data/doc/classes/LongDecimal.src/M000101.html +4 -4
- data/doc/classes/LongDecimal.src/M000102.html +4 -4
- data/doc/classes/LongDecimal.src/M000103.html +4 -4
- data/doc/classes/LongDecimalBase.html +53 -53
- 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 -4
- data/doc/classes/LongDecimalBase.src/M000112.html +4 -9
- data/doc/classes/LongDecimalBase.src/M000113.html +9 -9
- data/doc/classes/LongDecimalBase.src/M000116.html +9 -5
- data/doc/classes/LongDecimalBase.src/M000117.html +5 -4
- data/doc/classes/LongDecimalQuot.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 +2 -2
- 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/M000030.html +1 -1
- data/doc/classes/LongDecimalQuot.src/M000031.html +1 -1
- data/doc/classes/LongDecimalQuot.src/M000034.html +1 -1
- data/doc/classes/LongDecimalQuot.src/M000035.html +1 -1
- data/doc/classes/LongDecimalRoundingMode.html +6 -1
- data/doc/classes/LongDecimalRoundingMode/RoundingModeClass.html +37 -16
- data/doc/classes/LongMath.html +246 -161
- data/doc/classes/LongMath.src/M000119.html +5 -4
- data/doc/classes/LongMath.src/M000120.html +4 -4
- data/doc/classes/LongMath.src/M000121.html +4 -5
- data/doc/classes/LongMath.src/M000122.html +5 -4
- data/doc/classes/LongMath.src/M000123.html +4 -18
- data/doc/classes/LongMath.src/M000124.html +14 -14
- data/doc/classes/LongMath.src/M000125.html +18 -5
- data/doc/classes/LongMath.src/M000126.html +5 -29
- data/doc/classes/LongMath.src/M000127.html +29 -5
- data/doc/classes/LongMath.src/M000128.html +5 -57
- data/doc/classes/LongMath.src/M000129.html +55 -19
- data/doc/classes/LongMath.src/M000130.html +20 -35
- data/doc/classes/LongMath.src/M000131.html +36 -6
- data/doc/classes/LongMath.src/M000132.html +6 -33
- data/doc/classes/LongMath.src/M000133.html +26 -44
- data/doc/classes/LongMath.src/M000134.html +49 -5
- data/doc/classes/LongMath.src/M000135.html +7 -4
- data/doc/classes/LongMath.src/M000136.html +4 -4
- data/doc/classes/LongMath.src/M000137.html +4 -72
- data/doc/classes/LongMath.src/M000138.html +67 -39
- data/doc/classes/LongMath.src/M000139.html +44 -4
- data/doc/classes/LongMath.src/M000140.html +4 -4
- data/doc/classes/LongMath.src/M000141.html +4 -6
- data/doc/classes/LongMath.src/M000142.html +4 -18
- data/doc/classes/LongMath.src/M000143.html +8 -7
- data/doc/classes/LongMath.src/M000144.html +10 -35
- data/doc/classes/LongMath.src/M000145.html +23 -202
- data/doc/classes/LongMath.src/M000146.html +322 -4
- data/doc/classes/LongMath.src/M000147.html +22 -63
- data/doc/classes/LongMath.src/M000148.html +65 -33
- data/doc/classes/LongMath/CacheKey.html +5 -5
- data/doc/classes/Numeric.html +11 -11
- data/doc/classes/Numeric.src/M000105.html +9 -4
- data/doc/classes/Rational.html +6 -6
- 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 +102 -95
- data/lib/long-decimal.rb +206 -49
- data/test/testlongdecimal.rb +736 -21
- data/test/testlongdeclib.rb +136 -25
- data/test/testrandlib.rb +87 -0
- data/test/testrandom.rb +30 -45
- data/test/testrandpower.rb +72 -0
- metadata +4 -2
|
@@ -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 117</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 124</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-
|
|
15
|
-
<span class="ruby-keyword kw">self</span>
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 131</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-keyword kw">self</span>
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 138</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,19 +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-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>
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 145</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>
|
|
21
16
|
<span class="ruby-keyword kw">end</span></pre>
|
|
22
17
|
</body>
|
|
23
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 152</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>
|
|
@@ -5,15 +5,19 @@
|
|
|
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-identifier">
|
|
16
|
-
<span class="ruby-keyword kw">
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 182</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-operator"><=></span> (<span class="ruby-identifier">other</span>)
|
|
15
|
+
<span class="ruby-identifier">diff</span> = (<span class="ruby-keyword kw">self</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">other</span>)
|
|
16
|
+
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">diff</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">LongDecimalBase</span>) <span class="ruby-keyword kw">then</span>
|
|
17
|
+
<span class="ruby-identifier">diff</span>.<span class="ruby-identifier">sgn</span>
|
|
18
|
+
<span class="ruby-keyword kw">else</span>
|
|
19
|
+
<span class="ruby-identifier">diff</span> <span class="ruby-operator"><=></span> <span class="ruby-value">0</span>
|
|
20
|
+
<span class="ruby-keyword kw">end</span>
|
|
17
21
|
<span class="ruby-keyword kw">end</span></pre>
|
|
18
22
|
</body>
|
|
19
23
|
</html>
|
|
@@ -5,14 +5,15 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>scale_ufo (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-identifier">
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 194</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">scale_ufo</span>(<span class="ruby-identifier">other</span>)
|
|
15
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-value str">"only works for LongDecimal or LongDecimalQuot"</span> <span class="ruby-keyword kw">unless</span> (<span class="ruby-identifier">other</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">LongDecimalBase</span>)
|
|
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>
|
|
16
17
|
<span class="ruby-keyword kw">end</span></pre>
|
|
17
18
|
</body>
|
|
18
19
|
</html>
|
|
@@ -766,7 +766,7 @@ convert into Integer
|
|
|
766
766
|
<div class="method-heading">
|
|
767
767
|
<a href="LongDecimalQuot.src/M000012.html" target="Code" class="method-signature"
|
|
768
768
|
onclick="popupCode('LongDecimalQuot.src/M000012.html');return false;">
|
|
769
|
-
<span class="method-name">to_ld</span><span class="method-args">(prec = scale, mode =
|
|
769
|
+
<span class="method-name">to_ld</span><span class="method-args">(prec = scale, mode = LongMath.standard_mode)</span>
|
|
770
770
|
</a>
|
|
771
771
|
</div>
|
|
772
772
|
|
|
@@ -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 1283</span>
|
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">LongDecimalQuot</span>.<span class="ruby-identifier">new!</span>(<span class="ruby-identifier">first</span>, <span class="ruby-identifier">second</span>)
|
|
15
15
|
<span class="ruby-identifier">new</span>(<span class="ruby-identifier">first</span>, <span class="ruby-identifier">second</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 1291</span>
|
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">first</span>, <span class="ruby-identifier">second</span>)
|
|
15
15
|
<span class="ruby-ivar">@digits10</span> = <span class="ruby-keyword kw">nil</span>
|
|
16
16
|
<span class="ruby-keyword kw">if</span> ((<span class="ruby-identifier">first</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Rational</span>) <span class="ruby-operator">||</span> (<span class="ruby-identifier">first</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Integer</span>)) <span class="ruby-operator">&&</span> (<span class="ruby-identifier">second</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Integer</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 1329</span>
|
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">numerator</span>
|
|
15
15
|
<span class="ruby-identifier">rat</span>.<span class="ruby-identifier">numerator</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 1337</span>
|
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">denominator</span>
|
|
15
15
|
<span class="ruby-identifier">rat</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 1344</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 1355</span>
|
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
|
|
15
15
|
<span class="ruby-identifier">str</span> = <span class="ruby-ivar">@rat</span>.<span class="ruby-identifier">to_s</span>
|
|
16
16
|
<span class="ruby-identifier">str</span> <span class="ruby-operator">+</span> <span class="ruby-value str">"["</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">scale</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-value str">"]"</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 1363</span>
|
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_f</span>
|
|
15
15
|
<span class="ruby-identifier">to_r</span>.<span class="ruby-identifier">to_f</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 1370</span>
|
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_bd</span>
|
|
15
15
|
<span class="ruby-identifier">to_ld</span>.<span class="ruby-identifier">to_bd</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 1377</span>
|
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_i</span>
|
|
15
15
|
<span class="ruby-identifier">to_r</span>.<span class="ruby-identifier">to_i</span>
|
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
|
@@ -10,8 +10,8 @@
|
|
|
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">to_ld</span>(<span class="ruby-identifier">prec</span> = <span class="ruby-identifier">scale</span>, <span class="ruby-identifier">mode</span> = <span class="ruby-constant">
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 1386</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_ld</span>(<span class="ruby-identifier">prec</span> = <span class="ruby-identifier">scale</span>, <span class="ruby-identifier">mode</span> = <span class="ruby-constant">LongMath</span>.<span class="ruby-identifier">standard_mode</span>)
|
|
15
15
|
<span class="ruby-identifier">round_to_scale</span>(<span class="ruby-identifier">prec</span>, <span class="ruby-identifier">mode</span>)
|
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
|
17
17
|
</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 1405</span>
|
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sint_digits10</span>
|
|
15
15
|
<span class="ruby-keyword kw">if</span> (<span class="ruby-ivar">@digits10</span>.<span class="ruby-identifier">nil?</span>)
|
|
16
16
|
<span class="ruby-keyword kw">if</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 1426</span>
|
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">inc!</span>
|
|
15
15
|
<span class="ruby-ivar">@rat</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
|
16
16
|
<span class="ruby-ivar">@digits10</span> = <span class="ruby-keyword kw">nil</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 1434</span>
|
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">dec!</span>
|
|
15
15
|
<span class="ruby-ivar">@rat</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
|
|
16
16
|
<span class="ruby-ivar">@digits10</span> = <span class="ruby-keyword kw">nil</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 1443</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 1457</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">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 1472</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">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 1487</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">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 1502</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">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 1517</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-keyword kw">then</span>
|
|
16
16
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">is_int?</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 1544</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 1556</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 1564</span>
|
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">abs</span>
|
|
15
15
|
<span class="ruby-constant">LongDecimalQuot</span>(<span class="ruby-identifier">rat</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 1578</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-ivar">@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 1700</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 1748</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">other</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">LongDecimalQuot</span>) <span class="ruby-operator">&&</span> (<span class="ruby-keyword kw">self</span> <span class="ruby-operator"><=></span> <span class="ruby-identifier">other</span>) <span class="ruby-operator">==</span> <span class="ruby-value">0</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
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 1756</span>
|
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">zero?</span>
|
|
15
15
|
<span class="ruby-ivar">@rat</span>.<span class="ruby-identifier">zero?</span>
|
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|