long-decimal 0.01.01 → 0.01.02

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.
Files changed (193) hide show
  1. data/README +17 -94
  2. data/VERSION +1 -1
  3. data/doc/classes/Integer.html +239 -0
  4. data/doc/classes/Integer.src/M000036.html +18 -0
  5. data/doc/classes/Integer.src/M000039.html +145 -0
  6. data/doc/classes/LongDecimal.html +453 -399
  7. data/doc/classes/LongDecimal.src/M000040.html +4 -4
  8. data/doc/classes/LongDecimal.src/M000041.html +4 -4
  9. data/doc/classes/LongDecimal.src/M000042.html +4 -6
  10. data/doc/classes/LongDecimal.src/M000043.html +4 -106
  11. data/doc/classes/LongDecimal.src/M000044.html +4 -21
  12. data/doc/classes/LongDecimal.src/M000045.html +4 -11
  13. data/doc/classes/LongDecimal.src/M000046.html +6 -27
  14. data/doc/classes/LongDecimal.src/M000047.html +103 -16
  15. data/doc/classes/LongDecimal.src/M000048.html +21 -4
  16. data/doc/classes/LongDecimal.src/M000049.html +10 -14
  17. data/doc/classes/LongDecimal.src/M000050.html +22 -36
  18. data/doc/classes/LongDecimal.src/M000051.html +34 -4
  19. data/doc/classes/LongDecimal.src/M000052.html +17 -6
  20. data/doc/classes/LongDecimal.src/M000053.html +4 -6
  21. data/doc/classes/LongDecimal.src/M000054.html +15 -4
  22. data/doc/classes/LongDecimal.src/M000055.html +44 -12
  23. data/doc/classes/LongDecimal.src/M000056.html +4 -7
  24. data/doc/classes/LongDecimal.src/M000057.html +8 -4
  25. data/doc/classes/LongDecimal.src/M000058.html +6 -15
  26. data/doc/classes/LongDecimal.src/M000059.html +4 -13
  27. data/doc/classes/LongDecimal.src/M000060.html +15 -4
  28. data/doc/classes/LongDecimal.src/M000061.html +7 -5
  29. data/doc/classes/LongDecimal.src/M000062.html +4 -4
  30. data/doc/classes/LongDecimal.src/M000063.html +15 -5
  31. data/doc/classes/LongDecimal.src/M000064.html +13 -5
  32. data/doc/classes/LongDecimal.src/M000065.html +4 -4
  33. data/doc/classes/LongDecimal.src/M000067.html +4 -8
  34. data/doc/classes/LongDecimal.src/M000068.html +5 -9
  35. data/doc/classes/LongDecimal.src/M000069.html +5 -9
  36. data/doc/classes/LongDecimal.src/M000070.html +4 -9
  37. data/doc/classes/LongDecimal.src/M000071.html +4 -4
  38. data/doc/classes/LongDecimal.src/M000072.html +6 -17
  39. data/doc/classes/LongDecimal.src/M000073.html +7 -7
  40. data/doc/classes/LongDecimal.src/M000074.html +7 -7
  41. data/doc/classes/LongDecimal.src/M000075.html +7 -19
  42. data/doc/classes/LongDecimal.src/M000076.html +4 -8
  43. data/doc/classes/LongDecimal.src/M000077.html +19 -5
  44. data/doc/classes/LongDecimal.src/M000078.html +7 -7
  45. data/doc/classes/LongDecimal.src/M000079.html +7 -7
  46. data/doc/classes/LongDecimal.src/M000080.html +19 -7
  47. data/doc/classes/LongDecimal.src/M000081.html +8 -4
  48. data/doc/classes/LongDecimal.src/M000082.html +5 -7
  49. data/doc/classes/LongDecimal.src/M000083.html +8 -6
  50. data/doc/classes/LongDecimal.src/M000084.html +9 -4
  51. data/doc/classes/LongDecimal.src/M000085.html +9 -4
  52. data/doc/classes/LongDecimal.src/M000086.html +4 -9
  53. data/doc/classes/LongDecimal.src/M000087.html +6 -8
  54. data/doc/classes/LongDecimal.src/M000088.html +7 -5
  55. data/doc/classes/LongDecimal.src/M000089.html +4 -9
  56. data/doc/classes/LongDecimal.src/M000090.html +4 -4
  57. data/doc/classes/LongDecimal.src/M000091.html +9 -4
  58. data/doc/classes/LongDecimal.src/M000092.html +9 -4
  59. data/doc/classes/LongDecimal.src/M000093.html +5 -4
  60. data/doc/classes/LongDecimal.src/M000094.html +7 -57
  61. data/doc/classes/LongDecimal.src/M000095.html +4 -4
  62. data/doc/classes/LongDecimal.src/M000096.html +4 -4
  63. data/doc/classes/LongDecimal.src/M000097.html +4 -5
  64. data/doc/classes/LongDecimal.src/M000098.html +4 -5
  65. data/doc/classes/LongDecimal.src/M000099.html +59 -5
  66. data/doc/classes/LongDecimal.src/M000100.html +4 -5
  67. data/doc/classes/LongDecimal.src/M000101.html +4 -4
  68. data/doc/classes/LongDecimal.src/M000104.html +19 -0
  69. data/doc/classes/LongDecimal.src/M000105.html +19 -0
  70. data/doc/classes/LongDecimal.src/M000106.html +18 -0
  71. data/doc/classes/LongDecimal.src/M000107.html +18 -0
  72. data/doc/classes/LongDecimal.src/M000108.html +18 -0
  73. data/doc/classes/LongDecimal.src/M000109.html +18 -0
  74. data/doc/classes/LongDecimalBase.html +69 -66
  75. data/doc/classes/LongDecimalBase.src/M000113.html +4 -9
  76. data/doc/classes/LongDecimalBase.src/M000114.html +4 -5
  77. data/doc/classes/LongDecimalBase.src/M000115.html +4 -9
  78. data/doc/classes/LongDecimalBase.src/M000116.html +4 -9
  79. data/doc/classes/LongDecimalBase.src/M000117.html +4 -5
  80. data/doc/classes/LongDecimalBase.src/M000118.html +23 -0
  81. data/doc/classes/LongDecimalBase.src/M000121.html +23 -0
  82. data/doc/classes/LongDecimalBase.src/M000122.html +19 -0
  83. data/doc/classes/LongDecimalBase.src/M000123.html +18 -0
  84. data/doc/classes/LongDecimalQuot.html +33 -27
  85. data/doc/classes/LongDecimalQuot.src/M000003.html +1 -1
  86. data/doc/classes/LongDecimalQuot.src/M000004.html +1 -1
  87. data/doc/classes/LongDecimalQuot.src/M000005.html +1 -1
  88. data/doc/classes/LongDecimalQuot.src/M000006.html +1 -1
  89. data/doc/classes/LongDecimalQuot.src/M000007.html +1 -1
  90. data/doc/classes/LongDecimalQuot.src/M000008.html +1 -1
  91. data/doc/classes/LongDecimalQuot.src/M000009.html +1 -1
  92. data/doc/classes/LongDecimalQuot.src/M000010.html +1 -1
  93. data/doc/classes/LongDecimalQuot.src/M000011.html +1 -1
  94. data/doc/classes/LongDecimalQuot.src/M000012.html +1 -1
  95. data/doc/classes/LongDecimalQuot.src/M000013.html +1 -1
  96. data/doc/classes/LongDecimalQuot.src/M000014.html +1 -1
  97. data/doc/classes/LongDecimalQuot.src/M000015.html +1 -1
  98. data/doc/classes/LongDecimalQuot.src/M000016.html +1 -1
  99. data/doc/classes/LongDecimalQuot.src/M000017.html +1 -1
  100. data/doc/classes/LongDecimalQuot.src/M000018.html +1 -1
  101. data/doc/classes/LongDecimalQuot.src/M000019.html +1 -1
  102. data/doc/classes/LongDecimalQuot.src/M000020.html +1 -1
  103. data/doc/classes/LongDecimalQuot.src/M000021.html +1 -1
  104. data/doc/classes/LongDecimalQuot.src/M000022.html +1 -1
  105. data/doc/classes/LongDecimalQuot.src/M000023.html +1 -1
  106. data/doc/classes/LongDecimalQuot.src/M000024.html +1 -1
  107. data/doc/classes/LongDecimalQuot.src/M000025.html +1 -1
  108. data/doc/classes/LongDecimalQuot.src/M000026.html +1 -1
  109. data/doc/classes/LongDecimalQuot.src/M000027.html +1 -1
  110. data/doc/classes/LongDecimalQuot.src/M000028.html +1 -1
  111. data/doc/classes/LongDecimalQuot.src/M000029.html +1 -1
  112. data/doc/classes/LongDecimalQuot.src/M000030.html +1 -1
  113. data/doc/classes/LongDecimalQuot.src/M000031.html +1 -1
  114. data/doc/classes/LongDecimalQuot.src/M000034.html +1 -1
  115. data/doc/classes/LongDecimalQuot.src/M000035.html +1 -1
  116. data/doc/classes/LongDecimalRoundingMode/RoundingModeClass.html +25 -24
  117. data/doc/classes/LongDecimalRoundingMode/RoundingModeClass.src/M000156.html +22 -0
  118. data/doc/classes/LongDecimalRoundingMode/RoundingModeClass.src/M000157.html +18 -0
  119. data/doc/classes/LongDecimalRoundingMode/RoundingModeClass.src/M000158.html +18 -0
  120. data/doc/classes/LongDecimalRoundingMode/RoundingModeClass.src/M000159.html +18 -0
  121. data/doc/classes/LongDecimalRoundingMode/RoundingModeClass.src/M000161.html +25 -0
  122. data/doc/classes/LongDecimalRoundingMode/RoundingModeClass.src/M000162.html +18 -0
  123. data/doc/classes/LongDecimalRoundingMode/RoundingModeClass.src/M000163.html +18 -0
  124. data/doc/classes/LongDecimalRoundingMode/RoundingModeClass.src/M000164.html +18 -0
  125. data/doc/classes/LongDecimalRoundingMode/ZeroRoundingModeClass.html +178 -0
  126. data/doc/classes/LongDecimalRoundingMode/ZeroRoundingModeClass.src/M000165.html +25 -0
  127. data/doc/classes/LongDecimalRoundingMode/ZeroRoundingModeClass.src/M000166.html +18 -0
  128. data/doc/classes/LongDecimalRoundingMode.html +41 -4
  129. data/doc/classes/LongMath/CacheKey.html +10 -10
  130. data/doc/classes/LongMath/CacheKey.src/M000155.html +36 -0
  131. data/doc/classes/LongMath/CacheKey.src/M000160.html +36 -0
  132. data/doc/classes/LongMath.html +246 -235
  133. data/doc/classes/LongMath.src/M000124.html +5 -18
  134. data/doc/classes/LongMath.src/M000125.html +4 -18
  135. data/doc/classes/LongMath.src/M000126.html +4 -5
  136. data/doc/classes/LongMath.src/M000127.html +5 -29
  137. data/doc/classes/LongMath.src/M000128.html +4 -5
  138. data/doc/classes/LongMath.src/M000129.html +14 -53
  139. data/doc/classes/LongMath.src/M000130.html +17 -20
  140. data/doc/classes/LongMath.src/M000131.html +5 -36
  141. data/doc/classes/LongMath.src/M000132.html +29 -6
  142. data/doc/classes/LongMath.src/M000133.html +5 -33
  143. data/doc/classes/LongMath.src/M000134.html +47 -41
  144. data/doc/classes/LongMath.src/M000135.html +21 -7
  145. data/doc/classes/LongMath.src/M000136.html +36 -4
  146. data/doc/classes/LongMath.src/M000137.html +6 -4
  147. data/doc/classes/LongMath.src/M000138.html +31 -70
  148. data/doc/classes/LongMath.src/M000139.html +45 -38
  149. data/doc/classes/LongMath.src/M000140.html +7 -4
  150. data/doc/classes/LongMath.src/M000141.html +4 -4
  151. data/doc/classes/LongMath.src/M000142.html +4 -6
  152. data/doc/classes/LongMath.src/M000143.html +67 -14
  153. data/doc/classes/LongMath.src/M000144.html +39 -14
  154. data/doc/classes/LongMath.src/M000145.html +4 -44
  155. data/doc/classes/LongMath.src/M000146.html +5 -339
  156. data/doc/classes/LongMath.src/M000147.html +6 -25
  157. data/doc/classes/LongMath.src/M000148.html +14 -75
  158. data/doc/classes/LongMath.src/M000149.html +33 -0
  159. data/doc/classes/LongMath.src/M000150.html +58 -0
  160. data/doc/classes/LongMath.src/M000151.html +406 -0
  161. data/doc/classes/LongMath.src/M000152.html +63 -0
  162. data/doc/classes/LongMath.src/M000153.html +117 -0
  163. data/doc/classes/LongMath.src/M000154.html +150 -0
  164. data/doc/classes/LongMath.src/M000155.html +63 -0
  165. data/doc/classes/LongMath.src/M000156.html +18 -0
  166. data/doc/classes/LongMath.src/M000157.html +19 -0
  167. data/doc/classes/LongMath.src/M000158.html +18 -0
  168. data/doc/classes/LongMath.src/M000159.html +19 -0
  169. data/doc/classes/Numeric.html +23 -21
  170. data/doc/classes/Numeric.src/M000106.html +18 -0
  171. data/doc/classes/Numeric.src/M000110.html +23 -0
  172. data/doc/classes/Numeric.src/M000111.html +18 -0
  173. data/doc/classes/Rational.html +18 -16
  174. data/doc/classes/Rational.src/M000107.html +23 -0
  175. data/doc/classes/Rational.src/M000112.html +23 -0
  176. data/doc/created.rid +1 -1
  177. data/doc/dot/f_0.dot +23 -1
  178. data/doc/dot/f_0.png +0 -0
  179. data/doc/dot/m_0_0.png +0 -0
  180. data/doc/dot/m_0_1.dot +13 -0
  181. data/doc/dot/m_0_1.png +0 -0
  182. data/doc/files/lib/long-decimal_rb.html +15 -13
  183. data/doc/files/lib/long-decimal_rb.src/M000001.html +1 -1
  184. data/doc/files/lib/long-decimal_rb.src/M000002.html +1 -1
  185. data/doc/fr_class_index.html +2 -0
  186. data/doc/fr_method_index.html +131 -124
  187. data/lib/long-decimal.rb +373 -49
  188. data/test/testlongdecimal.rb +689 -7
  189. data/test/testlongdeclib.rb +51 -11
  190. data/test/testrandlib.rb +23 -7
  191. data/test/testrandom.rb +4 -4
  192. data/test/testrandpower.rb +11 -9
  193. metadata +48 -3
@@ -5,15 +5,69 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>== (LongDecimal)</title>
8
+ <title>coerce (LongDecimal)</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
10
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 1218</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-operator">==</span>(<span class="ruby-identifier">other</span>)
15
- <span class="ruby-comment cmt"># (other.kind_of? LongDecimal) &amp;&amp; (self &lt;=&gt; other) == 0 &amp;&amp; self.scale == other.scale</span>
16
- (<span class="ruby-identifier">other</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">LongDecimal</span>) <span class="ruby-operator">&amp;&amp;</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">&amp;&amp;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">scale</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">scale</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 1403</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">coerce</span>(<span class="ruby-identifier">other</span>)
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>
18
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">other</span>, <span class="ruby-keyword kw">self</span>
19
+
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>
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
+
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>
28
+ <span class="ruby-identifier">sc</span> = <span class="ruby-identifier">scale</span>
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>)
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>)
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) &amp;&amp; size &gt; 8 then</span>
38
+ <span class="ruby-comment cmt"># return coerce(BigDecimal(other.to_s))</span>
39
+
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>
42
+ <span class="ruby-identifier">other</span> = <span class="ruby-constant">LongDecimal</span>(<span class="ruby-identifier">other</span>)
43
+ <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">other</span>.<span class="ruby-identifier">scale</span> <span class="ruby-operator">&gt;</span> <span class="ruby-identifier">scale</span>) <span class="ruby-keyword kw">then</span>
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>)
45
+ <span class="ruby-keyword kw">end</span>
46
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">other</span>, <span class="ruby-keyword kw">self</span>
47
+
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>
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>)
51
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">o</span>, <span class="ruby-identifier">s</span>
52
+
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>
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>
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>))
59
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">o</span>, <span class="ruby-identifier">s</span>
60
+
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>
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>)
65
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">o</span>, <span class="ruby-identifier">s</span>
66
+
67
+ <span class="ruby-keyword kw">else</span>
68
+ <span class="ruby-comment cmt"># non-numeric types do not work here</span>
69
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-node">&quot;unsupported type #{other.inspect} for coerce of LongDecimal&quot;</span>
70
+ <span class="ruby-keyword kw">end</span>
17
71
  <span class="ruby-keyword kw">end</span></pre>
18
72
  </body>
19
73
  </html>
@@ -5,15 +5,14 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>=== (LongDecimal)</title>
8
+ <title>is_int? (LongDecimal)</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
10
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 1228</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-operator">===</span>(<span class="ruby-identifier">other</span>)
15
- <span class="ruby-comment cmt"># (other.kind_of? LongDecimal) &amp;&amp; self.int_val == other.int_val</span>
16
- (<span class="ruby-keyword kw">self</span> <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">other</span>).<span class="ruby-identifier">zero?</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 1465</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">is_int?</span>
15
+ <span class="ruby-identifier">scale</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">int_val</span> <span class="ruby-operator">%</span> <span class="ruby-value">10</span><span class="ruby-operator">**</span><span class="ruby-identifier">scale</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
17
16
  <span class="ruby-keyword kw">end</span></pre>
18
17
  </body>
19
18
  </html>
@@ -5,14 +5,14 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>zero? (LongDecimal)</title>
8
+ <title>sgn (LongDecimal)</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
10
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 1237</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">zero?</span>
15
- <span class="ruby-identifier">int_val</span>.<span class="ruby-identifier">zero?</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 1475</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sgn</span>
15
+ <span class="ruby-identifier">int_val</span> <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-value">0</span>
16
16
  <span class="ruby-keyword kw">end</span></pre>
17
17
  </body>
18
18
  </html>
@@ -0,0 +1,19 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>== (LongDecimal)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 1487</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-operator">==</span>(<span class="ruby-identifier">other</span>)
15
+ <span class="ruby-comment cmt"># (other.kind_of? LongDecimal) &amp;&amp; (self &lt;=&gt; other) == 0 &amp;&amp; self.scale == other.scale</span>
16
+ (<span class="ruby-identifier">other</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">LongDecimal</span>) <span class="ruby-operator">&amp;&amp;</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">&amp;&amp;</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>
17
+ <span class="ruby-keyword kw">end</span></pre>
18
+ </body>
19
+ </html>
@@ -0,0 +1,19 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>=== (LongDecimal)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 1497</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-operator">===</span>(<span class="ruby-identifier">other</span>)
15
+ <span class="ruby-comment cmt"># (other.kind_of? LongDecimal) &amp;&amp; self.int_val == other.int_val</span>
16
+ (<span class="ruby-keyword kw">self</span> <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">other</span>).<span class="ruby-identifier">zero?</span>
17
+ <span class="ruby-keyword kw">end</span></pre>
18
+ </body>
19
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>zero? (LongDecimal)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 1506</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">zero?</span>
15
+ <span class="ruby-identifier">int_val</span>.<span class="ruby-identifier">zero?</span>
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>one? (LongDecimal)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 1514</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">one?</span>
15
+ (<span class="ruby-keyword kw">self</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>).<span class="ruby-identifier">zero?</span>
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>hash (LongDecimal)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 1521</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">hash</span>
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
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>inspect (LongDecimal)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 1528</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">inspect</span>
15
+ <span class="ruby-identifier">sprintf</span>(<span class="ruby-value str">&quot;LongDecimal(%s, %s)&quot;</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
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -81,18 +81,20 @@
81
81
  <div id="contextContent">
82
82
  <div id="diagram">
83
83
  <map id="map" name="map">
84
- <area shape="RECT" coords="29,5,109,53" href="Comparable.html" alt="Comparable">
85
- <area shape="RECT" coords="60,204,140,252" href="LongMath/CacheKey.html" alt="CacheKey">
86
- <area shape="RECT" coords="56,101,184,149" href="LongDecimalRoundingMode/RoundingModeClass.html" alt="RoundingModeClass">
87
- <area shape="RECT" coords="201,204,319,252" href="LongDecimalBase.html" alt="LongDecimalBase">
88
- <area shape="RECT" coords="139,300,253,348" href="LongDecimalQuot.html" alt="LongDecimalQuot">
89
- <area shape="RECT" coords="277,300,371,348" href="LongDecimal.html" alt="LongDecimal">
90
- <area shape="RECT" coords="235,101,307,149" href="Numeric.html" alt="Numeric">
91
- <area shape="RECT" coords="133,5,205,53" href="Rational.html" alt="Rational">
92
- <area shape="RECT" coords="49,171,177,263" href="LongMath.html" alt="LongMath">
93
- <area shape="RECT" coords="45,68,221,160" href="LongDecimalRoundingMode.html" alt="LongDecimalRoundingMode">
84
+ <area shape="rect" coords="94,7,171,55" href="Comparable.html" alt="Comparable" />
85
+ <area shape="rect" coords="158,206,235,254" href="LongMath/CacheKey.html" alt="CacheKey" />
86
+ <area shape="rect" coords="231,103,356,151" href="LongDecimalRoundingMode/RoundingModeClass.html" alt="RoundingModeClass" />
87
+ <area shape="rect" coords="58,103,207,151" href="LongDecimalRoundingMode/ZeroRoundingModeClass.html" alt="ZeroRoundingModeClass" />
88
+ <area shape="rect" coords="355,206,470,254" href="LongDecimalBase.html" alt="LongDecimalBase" />
89
+ <area shape="rect" coords="294,302,406,350" href="LongDecimalQuot.html" alt="LongDecimalQuot" />
90
+ <area shape="rect" coords="195,7,267,55" href="Integer.html" alt="Integer" />
91
+ <area shape="rect" coords="430,302,520,350" href="LongDecimal.html" alt="LongDecimal" />
92
+ <area shape="rect" coords="407,103,479,151" href="Numeric.html" alt="Numeric" />
93
+ <area shape="rect" coords="291,7,363,55" href="Rational.html" alt="Rational" />
94
+ <area shape="rect" coords="147,172,272,264" href="LongMath.html" alt="LongMath" />
95
+ <area shape="rect" coords="47,70,394,162" href="LongDecimalRoundingMode.html" alt="LongDecimalRoundingMode" />
94
96
  </map>
95
- <img src="../dot/f_0.png" usemap="#map" border=0 alt="TopLevel">
97
+ <img src="../dot/f_0.png" usemap="#map" border="0" alt="dot/f_0.png">
96
98
  </div>
97
99
 
98
100
  <div id="description">
@@ -110,17 +112,17 @@ href="LongDecimalQuot.html">LongDecimalQuot</a>
110
112
  <h3 class="section-bar">Methods</h3>
111
113
 
112
114
  <div class="name-list">
113
- <a href="#M000111">+@</a>&nbsp;&nbsp;
114
- <a href="#M000116">&lt;=&gt;</a>&nbsp;&nbsp;
115
- <a href="#M000115">abs2</a>&nbsp;&nbsp;
116
- <a href="#M000110">dec</a>&nbsp;&nbsp;
117
- <a href="#M000109">inc</a>&nbsp;&nbsp;
118
- <a href="#M000114">inverse</a>&nbsp;&nbsp;
119
- <a href="#M000113">reciprocal</a>&nbsp;&nbsp;
120
- <a href="#M000118">scale_equal</a>&nbsp;&nbsp;
121
- <a href="#M000117">scale_ufo</a>&nbsp;&nbsp;
122
- <a href="#M000112">square</a>&nbsp;&nbsp;
123
- <a href="#M000108">to_r</a>&nbsp;&nbsp;
115
+ <a href="#M000116">+@</a>&nbsp;&nbsp;
116
+ <a href="#M000121">&lt;=&gt;</a>&nbsp;&nbsp;
117
+ <a href="#M000120">abs2</a>&nbsp;&nbsp;
118
+ <a href="#M000115">dec</a>&nbsp;&nbsp;
119
+ <a href="#M000114">inc</a>&nbsp;&nbsp;
120
+ <a href="#M000119">inverse</a>&nbsp;&nbsp;
121
+ <a href="#M000118">reciprocal</a>&nbsp;&nbsp;
122
+ <a href="#M000123">scale_equal</a>&nbsp;&nbsp;
123
+ <a href="#M000122">scale_ufo</a>&nbsp;&nbsp;
124
+ <a href="#M000117">square</a>&nbsp;&nbsp;
125
+ <a href="#M000113">to_r</a>&nbsp;&nbsp;
124
126
  </div>
125
127
  </div>
126
128
 
@@ -149,12 +151,12 @@ href="LongDecimalQuot.html">LongDecimalQuot</a>
149
151
  <div id="methods">
150
152
  <h3 class="section-bar">Public Instance methods</h3>
151
153
 
152
- <div id="method-M000111" class="method-detail">
153
- <a name="M000111"></a>
154
+ <div id="method-M000116" class="method-detail">
155
+ <a name="M000116"></a>
154
156
 
155
157
  <div class="method-heading">
156
- <a href="LongDecimalBase.src/M000111.html" target="Code" class="method-signature"
157
- onclick="popupCode('LongDecimalBase.src/M000111.html');return false;">
158
+ <a href="LongDecimalBase.src/M000116.html" target="Code" class="method-signature"
159
+ onclick="popupCode('LongDecimalBase.src/M000116.html');return false;">
158
160
  <span class="method-name">+@</span><span class="method-args">()</span>
159
161
  </a>
160
162
  </div>
@@ -166,12 +168,12 @@ unary plus returns self
166
168
  </div>
167
169
  </div>
168
170
 
169
- <div id="method-M000116" class="method-detail">
170
- <a name="M000116"></a>
171
+ <div id="method-M000121" class="method-detail">
172
+ <a name="M000121"></a>
171
173
 
172
174
  <div class="method-heading">
173
- <a href="LongDecimalBase.src/M000116.html" target="Code" class="method-signature"
174
- onclick="popupCode('LongDecimalBase.src/M000116.html');return false;">
175
+ <a href="LongDecimalBase.src/M000121.html" target="Code" class="method-signature"
176
+ onclick="popupCode('LongDecimalBase.src/M000121.html');return false;">
175
177
  <span class="method-name">&lt;=&gt;</span><span class="method-args">(other)</span>
176
178
  </a>
177
179
  </div>
@@ -193,8 +195,8 @@ of potentially zero digits after the decimal point.
193
195
  </div>
194
196
  </div>
195
197
 
196
- <div id="method-M000115" class="method-detail">
197
- <a name="M000115"></a>
198
+ <div id="method-M000120" class="method-detail">
199
+ <a name="M000120"></a>
198
200
 
199
201
  <div class="method-heading">
200
202
  <span class="method-name">abs2</span><span class="method-args">()</span>
@@ -202,17 +204,17 @@ of potentially zero digits after the decimal point.
202
204
 
203
205
  <div class="method-description">
204
206
  <p>
205
- Alias for <a href="LongDecimalBase.html#M000112">square</a>
207
+ Alias for <a href="LongDecimalBase.html#M000117">square</a>
206
208
  </p>
207
209
  </div>
208
210
  </div>
209
211
 
210
- <div id="method-M000110" class="method-detail">
211
- <a name="M000110"></a>
212
+ <div id="method-M000115" class="method-detail">
213
+ <a name="M000115"></a>
212
214
 
213
215
  <div class="method-heading">
214
- <a href="LongDecimalBase.src/M000110.html" target="Code" class="method-signature"
215
- onclick="popupCode('LongDecimalBase.src/M000110.html');return false;">
216
+ <a href="LongDecimalBase.src/M000115.html" target="Code" class="method-signature"
217
+ onclick="popupCode('LongDecimalBase.src/M000115.html');return false;">
216
218
  <span class="method-name">dec</span><span class="method-args">()</span>
217
219
  </a>
218
220
  </div>
@@ -224,12 +226,12 @@ self - 1
224
226
  </div>
225
227
  </div>
226
228
 
227
- <div id="method-M000109" class="method-detail">
228
- <a name="M000109"></a>
229
+ <div id="method-M000114" class="method-detail">
230
+ <a name="M000114"></a>
229
231
 
230
232
  <div class="method-heading">
231
- <a href="LongDecimalBase.src/M000109.html" target="Code" class="method-signature"
232
- onclick="popupCode('LongDecimalBase.src/M000109.html');return false;">
233
+ <a href="LongDecimalBase.src/M000114.html" target="Code" class="method-signature"
234
+ onclick="popupCode('LongDecimalBase.src/M000114.html');return false;">
233
235
  <span class="method-name">inc</span><span class="method-args">()</span>
234
236
  </a>
235
237
  </div>
@@ -241,8 +243,8 @@ self + 1
241
243
  </div>
242
244
  </div>
243
245
 
244
- <div id="method-M000114" class="method-detail">
245
- <a name="M000114"></a>
246
+ <div id="method-M000119" class="method-detail">
247
+ <a name="M000119"></a>
246
248
 
247
249
  <div class="method-heading">
248
250
  <span class="method-name">inverse</span><span class="method-args">()</span>
@@ -250,34 +252,35 @@ self + 1
250
252
 
251
253
  <div class="method-description">
252
254
  <p>
253
- Alias for <a href="LongDecimalBase.html#M000113">reciprocal</a>
255
+ Alias for <a href="LongDecimalBase.html#M000118">reciprocal</a>
254
256
  </p>
255
257
  </div>
256
258
  </div>
257
259
 
258
- <div id="method-M000113" class="method-detail">
259
- <a name="M000113"></a>
260
+ <div id="method-M000118" class="method-detail">
261
+ <a name="M000118"></a>
260
262
 
261
263
  <div class="method-heading">
262
- <a href="LongDecimalBase.src/M000113.html" target="Code" class="method-signature"
263
- onclick="popupCode('LongDecimalBase.src/M000113.html');return false;">
264
+ <a href="LongDecimalBase.src/M000118.html" target="Code" class="method-signature"
265
+ onclick="popupCode('LongDecimalBase.src/M000118.html');return false;">
264
266
  <span class="method-name">reciprocal</span><span class="method-args">()</span>
265
267
  </a>
266
268
  </div>
267
269
 
268
270
  <div class="method-description">
269
271
  <p>
270
- calculate the multiplicative inverse
272
+ calculate the multiplicative <a
273
+ href="LongDecimalBase.html#M000119">inverse</a>
271
274
  </p>
272
275
  </div>
273
276
  </div>
274
277
 
275
- <div id="method-M000118" class="method-detail">
276
- <a name="M000118"></a>
278
+ <div id="method-M000123" class="method-detail">
279
+ <a name="M000123"></a>
277
280
 
278
281
  <div class="method-heading">
279
- <a href="LongDecimalBase.src/M000118.html" target="Code" class="method-signature"
280
- onclick="popupCode('LongDecimalBase.src/M000118.html');return false;">
282
+ <a href="LongDecimalBase.src/M000123.html" target="Code" class="method-signature"
283
+ onclick="popupCode('LongDecimalBase.src/M000123.html');return false;">
281
284
  <span class="method-name">scale_equal</span><span class="method-args">(other)</span>
282
285
  </a>
283
286
  </div>
@@ -287,12 +290,12 @@ calculate the multiplicative inverse
287
290
  </div>
288
291
  </div>
289
292
 
290
- <div id="method-M000117" class="method-detail">
291
- <a name="M000117"></a>
293
+ <div id="method-M000122" class="method-detail">
294
+ <a name="M000122"></a>
292
295
 
293
296
  <div class="method-heading">
294
- <a href="LongDecimalBase.src/M000117.html" target="Code" class="method-signature"
295
- onclick="popupCode('LongDecimalBase.src/M000117.html');return false;">
297
+ <a href="LongDecimalBase.src/M000122.html" target="Code" class="method-signature"
298
+ onclick="popupCode('LongDecimalBase.src/M000122.html');return false;">
296
299
  <span class="method-name">scale_ufo</span><span class="method-args">(other)</span>
297
300
  </a>
298
301
  </div>
@@ -304,29 +307,29 @@ calculate the multiplicative inverse
304
307
  </div>
305
308
  </div>
306
309
 
307
- <div id="method-M000112" class="method-detail">
308
- <a name="M000112"></a>
310
+ <div id="method-M000117" class="method-detail">
311
+ <a name="M000117"></a>
309
312
 
310
313
  <div class="method-heading">
311
- <a href="LongDecimalBase.src/M000112.html" target="Code" class="method-signature"
312
- onclick="popupCode('LongDecimalBase.src/M000112.html');return false;">
314
+ <a href="LongDecimalBase.src/M000117.html" target="Code" class="method-signature"
315
+ onclick="popupCode('LongDecimalBase.src/M000117.html');return false;">
313
316
  <span class="method-name">square</span><span class="method-args">()</span>
314
317
  </a>
315
318
  </div>
316
319
 
317
320
  <div class="method-description">
318
321
  <p>
319
- calculate the square of self
322
+ calculate the <a href="LongDecimalBase.html#M000117">square</a> of self
320
323
  </p>
321
324
  </div>
322
325
  </div>
323
326
 
324
- <div id="method-M000108" class="method-detail">
325
- <a name="M000108"></a>
327
+ <div id="method-M000113" class="method-detail">
328
+ <a name="M000113"></a>
326
329
 
327
330
  <div class="method-heading">
328
- <a href="LongDecimalBase.src/M000108.html" target="Code" class="method-signature"
329
- onclick="popupCode('LongDecimalBase.src/M000108.html');return false;">
331
+ <a href="LongDecimalBase.src/M000113.html" target="Code" class="method-signature"
332
+ onclick="popupCode('LongDecimalBase.src/M000113.html');return false;">
330
333
  <span class="method-name">to_r</span><span class="method-args">()</span>
331
334
  </a>
332
335
  </div>
@@ -5,19 +5,14 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>reciprocal (LongDecimalBase)</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 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>
13
+ <pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 326</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>)
21
16
  <span class="ruby-keyword kw">end</span></pre>
22
17
  </body>
23
18
  </html>
@@ -5,15 +5,14 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>scale_ufo (LongDecimalBase)</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 147</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">&quot;only works for LongDecimal or LongDecimalQuot&quot;</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">&lt;=&gt;</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">scale</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 333</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>
17
16
  <span class="ruby-keyword kw">end</span></pre>
18
17
  </body>
19
18
  </html>
@@ -5,19 +5,14 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>&lt;=&gt; (LongDecimalBase)</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 159</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-operator">&lt;=&gt;</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">&lt;=&gt;</span> <span class="ruby-value">0</span>
20
- <span class="ruby-keyword kw">end</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/long-decimal.rb, line 340</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>
21
16
  <span class="ruby-keyword kw">end</span></pre>
22
17
  </body>
23
18
  </html>