long-decimal 0.00.16 → 0.00.17
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 +16 -15
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/doc/classes/LongDecimal.html +15 -8
- data/doc/classes/LongDecimal.src/M000041.html +3 -2
- 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 -3
- 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 +7 -3
- 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 +30 -4
- 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/LongDecimalBase.html +58 -57
- data/doc/classes/LongDecimalBase.src/M000102.html +4 -4
- data/doc/classes/LongDecimalBase.src/M000103.html +4 -4
- data/doc/classes/LongDecimalBase.src/M000104.html +4 -4
- 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 +18 -0
- data/doc/classes/LongDecimalBase.src/M000110.html +9 -5
- data/doc/classes/LongDecimalBase.src/M000111.html +5 -4
- data/doc/classes/LongDecimalBase.src/M000112.html +18 -0
- data/doc/classes/LongDecimalQuot.html +18 -13
- 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 +3 -3
- 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 +35 -2
- data/doc/classes/LongDecimalQuot.src/M000024.html +20 -4
- 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/M000137.html +22 -0
- data/doc/classes/LongMath.html +135 -116
- data/doc/classes/LongMath.src/M000113.html +5 -4
- data/doc/classes/LongMath.src/M000114.html +4 -4
- data/doc/classes/LongMath.src/M000115.html +4 -5
- data/doc/classes/LongMath.src/M000116.html +5 -4
- data/doc/classes/LongMath.src/M000117.html +4 -18
- data/doc/classes/LongMath.src/M000118.html +14 -14
- data/doc/classes/LongMath.src/M000119.html +18 -5
- data/doc/classes/LongMath.src/M000120.html +5 -29
- data/doc/classes/LongMath.src/M000121.html +29 -5
- data/doc/classes/LongMath.src/M000122.html +5 -56
- data/doc/classes/LongMath.src/M000123.html +54 -19
- data/doc/classes/LongMath.src/M000124.html +20 -35
- data/doc/classes/LongMath.src/M000125.html +31 -27
- data/doc/classes/LongMath.src/M000126.html +32 -8
- data/doc/classes/LongMath.src/M000127.html +8 -13
- data/doc/classes/LongMath.src/M000128.html +13 -82
- data/doc/classes/LongMath.src/M000129.html +79 -4
- data/doc/classes/LongMath.src/M000130.html +4 -14
- data/doc/classes/LongMath.src/M000131.html +4 -14
- data/doc/classes/LongMath.src/M000132.html +13 -148
- data/doc/classes/LongMath.src/M000133.html +14 -8
- data/doc/classes/LongMath.src/M000134.html +127 -3
- data/doc/classes/LongMath.src/M000135.html +25 -0
- data/doc/classes/LongMath.src/M000136.html +42 -0
- data/doc/classes/Numeric.html +5 -2
- data/doc/classes/Numeric.src/M000100.html +8 -3
- data/doc/classes/Rational.html +158 -0
- data/doc/classes/Rational.src/M000101.html +23 -0
- data/doc/created.rid +1 -1
- data/doc/dot/f_0.dot +9 -0
- data/doc/dot/f_0.png +0 -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_class_index.html +1 -0
- data/doc/fr_method_index.html +56 -54
- data/lib/long-decimal.rb +147 -29
- data/test/testlongdecimal.rb +58 -5
- data/version.rb +1 -1
- metadata +10 -3
- data/doc/files/lib/long-decimal_rb.html +0 -187
@@ -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_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 788</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 807</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 827</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 850</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 861</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 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">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 881</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 893</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 905</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>
|
@@ -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 912</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">unless</span> (<span class="ruby-identifier">other</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Fixnum</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-keyword kw">then</span>
|
16
16
|
<span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-value str">"cannot shift by something other than Fixnum >= 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 922</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">unless</span> (<span class="ruby-identifier">other</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Fixnum</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-keyword kw">then</span>
|
16
16
|
<span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-value str">"cannot shift by something other than Fixnum >= 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 932</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">int_val</span>[<span class="ruby-identifier">other</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 939</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">size</span>
|
15
15
|
<span class="ruby-identifier">int_val</span>.<span class="ruby-identifier">size</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 946</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">move_point_left</span>(<span class="ruby-identifier">n</span>)
|
15
15
|
<span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-value str">"only implemented for Fixnum"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">n</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Fixnum</span>
|
16
16
|
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">n</span> <span class="ruby-operator">>=</span> <span class="ruby-value">0</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 958</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">move_point_right</span>(<span class="ruby-identifier">n</span>)
|
15
15
|
<span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-value str">"only implemented for Fixnum"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">n</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Fixnum</span>
|
16
16
|
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">n</span> <span class="ruby-operator"><</span> <span class="ruby-value">0</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 971</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">move_point_left_int</span>(<span class="ruby-identifier">n</span>)
|
15
15
|
<span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-value str">"only implemented for Fixnum >= 0"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">n</span> <span class="ruby-operator">>=</span> <span class="ruby-value">0</span>
|
16
16
|
<span class="ruby-constant">LongDecimal</span>(<span class="ruby-identifier">int_val</span>, <span class="ruby-identifier">scale</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">n</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 980</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">move_point_right_int</span>(<span class="ruby-identifier">n</span>)
|
15
15
|
<span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-value str">"only implemented for Fixnum >= 0"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">n</span> <span class="ruby-operator">>=</span> <span class="ruby-value">0</span>
|
16
16
|
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">n</span> <span class="ruby-operator">></span> <span class="ruby-identifier">scale</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 994</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">square</span>
|
15
15
|
<span class="ruby-keyword kw">self</span> <span class="ruby-operator">*</span> <span class="ruby-keyword kw">self</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 1004</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
15
|
<span class="ruby-identifier">sqrt_internal</span>(<span class="ruby-identifier">new_scale</span>, <span class="ruby-identifier">rounding_mode</span>, <span class="ruby-keyword kw">false</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 1014</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
15
|
<span class="ruby-identifier">sqrt_internal</span>(<span class="ruby-identifier">new_scale</span>, <span class="ruby-constant">ROUND_DOWN</span>, <span class="ruby-keyword kw">true</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 1052</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,36 +10,62 @@
|
|
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 1061</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
|
<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>
|
17
|
+
<span class="ruby-comment cmt"># if other is LongDecimal as well, nothing to do</span>
|
16
18
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">other</span>, <span class="ruby-keyword kw">self</span>
|
19
|
+
|
17
20
|
<span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">LongDecimalQuot</span> <span class="ruby-keyword kw">then</span>
|
21
|
+
<span class="ruby-comment cmt"># if other is LongDecimalQuot, convert self to LongDecimalQuot</span>
|
22
|
+
<span class="ruby-comment cmt"># as well</span>
|
18
23
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">other</span>, <span class="ruby-constant">LongDecimalQuot</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">to_r</span>, <span class="ruby-identifier">scale</span>)
|
24
|
+
|
19
25
|
<span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Rational</span> <span class="ruby-keyword kw">then</span>
|
26
|
+
<span class="ruby-comment cmt"># if other is Rational, convert self and other to</span>
|
27
|
+
<span class="ruby-comment cmt"># LongDecimalQuot. This is well adapted to cover both.</span>
|
20
28
|
<span class="ruby-identifier">sc</span> = <span class="ruby-identifier">scale</span>
|
21
29
|
<span class="ruby-identifier">o</span> = <span class="ruby-constant">LongDecimalQuot</span>(<span class="ruby-identifier">other</span>, <span class="ruby-identifier">sc</span>)
|
22
30
|
<span class="ruby-identifier">s</span> = <span class="ruby-constant">LongDecimalQuot</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">to_r</span>, <span class="ruby-identifier">sc</span>)
|
23
31
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">o</span>, <span class="ruby-identifier">s</span>
|
32
|
+
|
33
|
+
<span class="ruby-comment cmt"># we could use BigDecimal as common type for combining Float and</span>
|
34
|
+
<span class="ruby-comment cmt"># LongDecimal, but this needs a lot of consideration. For the</span>
|
35
|
+
<span class="ruby-comment cmt"># time being we assume that we live well enough with converting</span>
|
36
|
+
<span class="ruby-comment cmt"># Float into LongDecimal</span>
|
37
|
+
<span class="ruby-comment cmt"># elsif (other.kind_of? Float) && size > 8 then</span>
|
38
|
+
<span class="ruby-comment cmt"># return coerce(BigDecimal(other.to_s))</span>
|
39
|
+
|
24
40
|
<span class="ruby-keyword kw">elsif</span> (<span class="ruby-identifier">other</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Integer</span>) <span class="ruby-operator">||</span> (<span class="ruby-identifier">other</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Float</span>) <span class="ruby-keyword kw">then</span>
|
41
|
+
<span class="ruby-comment cmt"># if other is Integer or Float, convert it to LongDecimal</span>
|
25
42
|
<span class="ruby-identifier">other</span> = <span class="ruby-constant">LongDecimal</span>(<span class="ruby-identifier">other</span>)
|
26
43
|
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">other</span>.<span class="ruby-identifier">scale</span> <span class="ruby-operator">></span> <span class="ruby-identifier">scale</span>) <span class="ruby-keyword kw">then</span>
|
27
44
|
<span class="ruby-identifier">other</span> = <span class="ruby-identifier">other</span>.<span class="ruby-identifier">round_to_scale</span>(<span class="ruby-identifier">scale</span>, <span class="ruby-constant">ROUND_HALF_UP</span>)
|
28
45
|
<span class="ruby-keyword kw">end</span>
|
29
46
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">other</span>, <span class="ruby-keyword kw">self</span>
|
47
|
+
|
30
48
|
<span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">BigDecimal</span> <span class="ruby-keyword kw">then</span>
|
49
|
+
<span class="ruby-comment cmt"># if other is BigDecimal convert self to BigDecimal</span>
|
31
50
|
<span class="ruby-identifier">s</span>, <span class="ruby-identifier">o</span> = <span class="ruby-identifier">other</span>.<span class="ruby-identifier">coerce</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">to_bd</span>)
|
32
51
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">o</span>, <span class="ruby-identifier">s</span>
|
52
|
+
|
33
53
|
<span class="ruby-keyword kw">elsif</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>
|
34
|
-
<span class="ruby-comment cmt">#
|
54
|
+
<span class="ruby-comment cmt"># if other is Complex, convert self to Float and then to</span>
|
55
|
+
<span class="ruby-comment cmt"># Complex. It need to be observed that this will fail if self</span>
|
56
|
+
<span class="ruby-comment cmt"># has too many digits before the decimal point to be expressed</span>
|
57
|
+
<span class="ruby-comment cmt"># as Float.</span>
|
35
58
|
<span class="ruby-identifier">s</span>, <span class="ruby-identifier">o</span> = <span class="ruby-identifier">other</span>.<span class="ruby-identifier">coerce</span>(<span class="ruby-constant">Complex</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">to_f</span>, <span class="ruby-value">0</span>))
|
36
59
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">o</span>, <span class="ruby-identifier">s</span>
|
37
|
-
|
38
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">coerce</span>(<span class="ruby-constant">BigDecimal</span>(<span class="ruby-identifier">other</span>.<span class="ruby-identifier">to_s</span>))
|
60
|
+
|
39
61
|
<span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Numeric</span> <span class="ruby-keyword kw">then</span>
|
62
|
+
<span class="ruby-comment cmt"># all other go by expressing self as Float and seeing how it</span>
|
63
|
+
<span class="ruby-comment cmt"># combines with other.</span>
|
40
64
|
<span class="ruby-identifier">s</span>, <span class="ruby-identifier">o</span> = <span class="ruby-identifier">other</span>.<span class="ruby-identifier">coerce</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">to_f</span>)
|
41
65
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">o</span>, <span class="ruby-identifier">s</span>
|
66
|
+
|
42
67
|
<span class="ruby-keyword kw">else</span>
|
68
|
+
<span class="ruby-comment cmt"># non-numeric types do not work here</span>
|
43
69
|
<span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-node">"unsupported type #{other.inspect} for coerce of LongDecimal"</span>
|
44
70
|
<span class="ruby-keyword kw">end</span>
|
45
71
|
<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 1123</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 1133</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 1145</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 1155</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">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>
|
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 1163</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 1171</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 1178</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 1185</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>
|
@@ -87,6 +87,7 @@
|
|
87
87
|
<area shape="RECT" coords="6,293,120,341" href="LongDecimalQuot.html" alt="LongDecimalQuot">
|
88
88
|
<area shape="RECT" coords="144,293,238,341" href="LongDecimal.html" alt="LongDecimal">
|
89
89
|
<area shape="RECT" coords="43,101,115,149" href="Numeric.html" alt="Numeric">
|
90
|
+
<area shape="RECT" coords="267,5,339,53" href="Rational.html" alt="Rational">
|
90
91
|
<area shape="RECT" coords="246,187,339,233" href="LongMath.html" alt="LongMath">
|
91
92
|
<area shape="RECT" coords="128,68,304,160" href="LongDecimalRoundingMode.html" alt="LongDecimalRoundingMode">
|
92
93
|
</map>
|
@@ -108,17 +109,17 @@ href="LongDecimalQuot.html">LongDecimalQuot</a>
|
|
108
109
|
<h3 class="section-bar">Methods</h3>
|
109
110
|
|
110
111
|
<div class="name-list">
|
111
|
-
<a href="#
|
112
|
-
<a href="#
|
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="#
|
112
|
+
<a href="#M000105">+@</a>
|
113
|
+
<a href="#M000110"><=></a>
|
114
|
+
<a href="#M000109">abs2</a>
|
115
|
+
<a href="#M000104">dec</a>
|
116
|
+
<a href="#M000103">inc</a>
|
117
|
+
<a href="#M000108">inverse</a>
|
118
|
+
<a href="#M000107">reciprocal</a>
|
119
|
+
<a href="#M000112">scale_equal</a>
|
120
|
+
<a href="#M000111">scale_ufo</a>
|
121
|
+
<a href="#M000106">square</a>
|
122
|
+
<a href="#M000102">to_r</a>
|
122
123
|
</div>
|
123
124
|
</div>
|
124
125
|
|
@@ -147,12 +148,12 @@ href="LongDecimalQuot.html">LongDecimalQuot</a>
|
|
147
148
|
<div id="methods">
|
148
149
|
<h3 class="section-bar">Public Instance methods</h3>
|
149
150
|
|
150
|
-
<div id="method-
|
151
|
-
<a name="
|
151
|
+
<div id="method-M000105" class="method-detail">
|
152
|
+
<a name="M000105"></a>
|
152
153
|
|
153
154
|
<div class="method-heading">
|
154
|
-
<a href="LongDecimalBase.src/
|
155
|
-
onclick="popupCode('LongDecimalBase.src/
|
155
|
+
<a href="LongDecimalBase.src/M000105.html" target="Code" class="method-signature"
|
156
|
+
onclick="popupCode('LongDecimalBase.src/M000105.html');return false;">
|
156
157
|
<span class="method-name">+@</span><span class="method-args">()</span>
|
157
158
|
</a>
|
158
159
|
</div>
|
@@ -164,12 +165,12 @@ unary plus returns self
|
|
164
165
|
</div>
|
165
166
|
</div>
|
166
167
|
|
167
|
-
<div id="method-
|
168
|
-
<a name="
|
168
|
+
<div id="method-M000110" class="method-detail">
|
169
|
+
<a name="M000110"></a>
|
169
170
|
|
170
171
|
<div class="method-heading">
|
171
|
-
<a href="LongDecimalBase.src/
|
172
|
-
onclick="popupCode('LongDecimalBase.src/
|
172
|
+
<a href="LongDecimalBase.src/M000110.html" target="Code" class="method-signature"
|
173
|
+
onclick="popupCode('LongDecimalBase.src/M000110.html');return false;">
|
173
174
|
<span class="method-name"><=></span><span class="method-args">(other)</span>
|
174
175
|
</a>
|
175
176
|
</div>
|
@@ -191,8 +192,8 @@ of potentially zero digits after the decimal point.
|
|
191
192
|
</div>
|
192
193
|
</div>
|
193
194
|
|
194
|
-
<div id="method-
|
195
|
-
<a name="
|
195
|
+
<div id="method-M000109" class="method-detail">
|
196
|
+
<a name="M000109"></a>
|
196
197
|
|
197
198
|
<div class="method-heading">
|
198
199
|
<span class="method-name">abs2</span><span class="method-args">()</span>
|
@@ -200,17 +201,17 @@ of potentially zero digits after the decimal point.
|
|
200
201
|
|
201
202
|
<div class="method-description">
|
202
203
|
<p>
|
203
|
-
Alias for <a href="LongDecimalBase.html#
|
204
|
+
Alias for <a href="LongDecimalBase.html#M000106">square</a>
|
204
205
|
</p>
|
205
206
|
</div>
|
206
207
|
</div>
|
207
208
|
|
208
|
-
<div id="method-
|
209
|
-
<a name="
|
209
|
+
<div id="method-M000104" class="method-detail">
|
210
|
+
<a name="M000104"></a>
|
210
211
|
|
211
212
|
<div class="method-heading">
|
212
|
-
<a href="LongDecimalBase.src/
|
213
|
-
onclick="popupCode('LongDecimalBase.src/
|
213
|
+
<a href="LongDecimalBase.src/M000104.html" target="Code" class="method-signature"
|
214
|
+
onclick="popupCode('LongDecimalBase.src/M000104.html');return false;">
|
214
215
|
<span class="method-name">dec</span><span class="method-args">()</span>
|
215
216
|
</a>
|
216
217
|
</div>
|
@@ -222,12 +223,12 @@ self - 1
|
|
222
223
|
</div>
|
223
224
|
</div>
|
224
225
|
|
225
|
-
<div id="method-
|
226
|
-
<a name="
|
226
|
+
<div id="method-M000103" class="method-detail">
|
227
|
+
<a name="M000103"></a>
|
227
228
|
|
228
229
|
<div class="method-heading">
|
229
|
-
<a href="LongDecimalBase.src/
|
230
|
-
onclick="popupCode('LongDecimalBase.src/
|
230
|
+
<a href="LongDecimalBase.src/M000103.html" target="Code" class="method-signature"
|
231
|
+
onclick="popupCode('LongDecimalBase.src/M000103.html');return false;">
|
231
232
|
<span class="method-name">inc</span><span class="method-args">()</span>
|
232
233
|
</a>
|
233
234
|
</div>
|
@@ -239,8 +240,8 @@ self + 1
|
|
239
240
|
</div>
|
240
241
|
</div>
|
241
242
|
|
242
|
-
<div id="method-
|
243
|
-
<a name="
|
243
|
+
<div id="method-M000108" class="method-detail">
|
244
|
+
<a name="M000108"></a>
|
244
245
|
|
245
246
|
<div class="method-heading">
|
246
247
|
<span class="method-name">inverse</span><span class="method-args">()</span>
|
@@ -248,17 +249,17 @@ self + 1
|
|
248
249
|
|
249
250
|
<div class="method-description">
|
250
251
|
<p>
|
251
|
-
Alias for <a href="LongDecimalBase.html#
|
252
|
+
Alias for <a href="LongDecimalBase.html#M000107">reciprocal</a>
|
252
253
|
</p>
|
253
254
|
</div>
|
254
255
|
</div>
|
255
256
|
|
256
|
-
<div id="method-
|
257
|
-
<a name="
|
257
|
+
<div id="method-M000107" class="method-detail">
|
258
|
+
<a name="M000107"></a>
|
258
259
|
|
259
260
|
<div class="method-heading">
|
260
|
-
<a href="LongDecimalBase.src/
|
261
|
-
onclick="popupCode('LongDecimalBase.src/
|
261
|
+
<a href="LongDecimalBase.src/M000107.html" target="Code" class="method-signature"
|
262
|
+
onclick="popupCode('LongDecimalBase.src/M000107.html');return false;">
|
262
263
|
<span class="method-name">reciprocal</span><span class="method-args">()</span>
|
263
264
|
</a>
|
264
265
|
</div>
|
@@ -270,12 +271,12 @@ calculate the multiplicative inverse
|
|
270
271
|
</div>
|
271
272
|
</div>
|
272
273
|
|
273
|
-
<div id="method-
|
274
|
-
<a name="
|
274
|
+
<div id="method-M000112" class="method-detail">
|
275
|
+
<a name="M000112"></a>
|
275
276
|
|
276
277
|
<div class="method-heading">
|
277
|
-
<a href="LongDecimalBase.src/
|
278
|
-
onclick="popupCode('LongDecimalBase.src/
|
278
|
+
<a href="LongDecimalBase.src/M000112.html" target="Code" class="method-signature"
|
279
|
+
onclick="popupCode('LongDecimalBase.src/M000112.html');return false;">
|
279
280
|
<span class="method-name">scale_equal</span><span class="method-args">(other)</span>
|
280
281
|
</a>
|
281
282
|
</div>
|
@@ -285,12 +286,12 @@ calculate the multiplicative inverse
|
|
285
286
|
</div>
|
286
287
|
</div>
|
287
288
|
|
288
|
-
<div id="method-
|
289
|
-
<a name="
|
289
|
+
<div id="method-M000111" class="method-detail">
|
290
|
+
<a name="M000111"></a>
|
290
291
|
|
291
292
|
<div class="method-heading">
|
292
|
-
<a href="LongDecimalBase.src/
|
293
|
-
onclick="popupCode('LongDecimalBase.src/
|
293
|
+
<a href="LongDecimalBase.src/M000111.html" target="Code" class="method-signature"
|
294
|
+
onclick="popupCode('LongDecimalBase.src/M000111.html');return false;">
|
294
295
|
<span class="method-name">scale_ufo</span><span class="method-args">(other)</span>
|
295
296
|
</a>
|
296
297
|
</div>
|
@@ -302,12 +303,12 @@ calculate the multiplicative inverse
|
|
302
303
|
</div>
|
303
304
|
</div>
|
304
305
|
|
305
|
-
<div id="method-
|
306
|
-
<a name="
|
306
|
+
<div id="method-M000106" class="method-detail">
|
307
|
+
<a name="M000106"></a>
|
307
308
|
|
308
309
|
<div class="method-heading">
|
309
|
-
<a href="LongDecimalBase.src/
|
310
|
-
onclick="popupCode('LongDecimalBase.src/
|
310
|
+
<a href="LongDecimalBase.src/M000106.html" target="Code" class="method-signature"
|
311
|
+
onclick="popupCode('LongDecimalBase.src/M000106.html');return false;">
|
311
312
|
<span class="method-name">square</span><span class="method-args">()</span>
|
312
313
|
</a>
|
313
314
|
</div>
|
@@ -319,22 +320,22 @@ calculate the square of self
|
|
319
320
|
</div>
|
320
321
|
</div>
|
321
322
|
|
322
|
-
<div id="method-
|
323
|
-
<a name="
|
323
|
+
<div id="method-M000102" class="method-detail">
|
324
|
+
<a name="M000102"></a>
|
324
325
|
|
325
326
|
<div class="method-heading">
|
326
|
-
<a href="LongDecimalBase.src/
|
327
|
-
onclick="popupCode('LongDecimalBase.src/
|
327
|
+
<a href="LongDecimalBase.src/M000102.html" target="Code" class="method-signature"
|
328
|
+
onclick="popupCode('LongDecimalBase.src/M000102.html');return false;">
|
328
329
|
<span class="method-name">to_r</span><span class="method-args">()</span>
|
329
330
|
</a>
|
330
331
|
</div>
|
331
332
|
|
332
333
|
<div class="method-description">
|
333
334
|
<p>
|
334
|
-
convert self into Rational this works quite
|
335
|
-
href="LongDecimal.html">LongDecimal</a> use
|
336
|
-
power of 10 as denominator, which happens to be
|
337
|
-
denominator are defined
|
335
|
+
convert self into <a href="Rational.html">Rational</a> this works quite
|
336
|
+
straitforward. in case of <a href="LongDecimal.html">LongDecimal</a> use
|
337
|
+
int_val as numerator and a power of 10 as denominator, which happens to be
|
338
|
+
the way numerator and denominator are defined
|
338
339
|
</p>
|
339
340
|
</div>
|
340
341
|
</div>
|