long-decimal 0.00.08 → 0.00.09
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/doc/classes/LongDecimal.html +1432 -0
- data/doc/classes/LongDecimal.src/M000040.html +18 -0
- data/doc/classes/LongDecimal.src/M000041.html +18 -0
- data/doc/classes/LongDecimal.src/M000042.html +18 -0
- data/doc/classes/LongDecimal.src/M000043.html +18 -0
- data/doc/classes/LongDecimal.src/M000044.html +18 -0
- data/doc/classes/LongDecimal.src/M000045.html +18 -0
- data/doc/classes/LongDecimal.src/M000046.html +20 -0
- data/doc/classes/LongDecimal.src/M000047.html +109 -0
- data/doc/classes/LongDecimal.src/M000048.html +18 -0
- data/doc/classes/LongDecimal.src/M000049.html +18 -0
- data/doc/classes/LongDecimal.src/M000050.html +34 -0
- data/doc/classes/LongDecimal.src/M000051.html +41 -0
- data/doc/classes/LongDecimal.src/M000052.html +35 -0
- data/doc/classes/LongDecimal.src/M000053.html +18 -0
- data/doc/classes/LongDecimal.src/M000054.html +29 -0
- data/doc/classes/LongDecimal.src/M000055.html +18 -0
- data/doc/classes/LongDecimal.src/M000056.html +22 -0
- data/doc/classes/LongDecimal.src/M000057.html +18 -0
- data/doc/classes/LongDecimal.src/M000058.html +18 -0
- data/doc/classes/LongDecimal.src/M000059.html +20 -0
- data/doc/classes/LongDecimal.src/M000060.html +18 -0
- data/doc/classes/LongDecimal.src/M000062.html +29 -0
- data/doc/classes/LongDecimal.src/M000063.html +27 -0
- data/doc/classes/LongDecimal.src/M000064.html +18 -0
- data/doc/classes/LongDecimal.src/M000066.html +18 -0
- data/doc/classes/LongDecimal.src/M000067.html +18 -0
- data/doc/classes/LongDecimal.src/M000068.html +18 -0
- data/doc/classes/LongDecimal.src/M000069.html +18 -0
- data/doc/classes/LongDecimal.src/M000070.html +18 -0
- data/doc/classes/LongDecimal.src/M000071.html +22 -0
- data/doc/classes/LongDecimal.src/M000072.html +23 -0
- data/doc/classes/LongDecimal.src/M000073.html +23 -0
- data/doc/classes/LongDecimal.src/M000074.html +23 -0
- data/doc/classes/LongDecimal.src/M000075.html +18 -0
- data/doc/classes/LongDecimal.src/M000076.html +29 -0
- data/doc/classes/LongDecimal.src/M000077.html +23 -0
- data/doc/classes/LongDecimal.src/M000078.html +23 -0
- data/doc/classes/LongDecimal.src/M000079.html +34 -0
- data/doc/classes/LongDecimal.src/M000080.html +22 -0
- data/doc/classes/LongDecimal.src/M000081.html +19 -0
- data/doc/classes/LongDecimal.src/M000082.html +23 -0
- data/doc/classes/LongDecimal.src/M000083.html +23 -0
- data/doc/classes/LongDecimal.src/M000084.html +23 -0
- data/doc/classes/LongDecimal.src/M000085.html +18 -0
- data/doc/classes/LongDecimal.src/M000086.html +21 -0
- data/doc/classes/LongDecimal.src/M000087.html +21 -0
- data/doc/classes/LongDecimal.src/M000088.html +18 -0
- data/doc/classes/LongDecimal.src/M000089.html +18 -0
- data/doc/classes/LongDecimal.src/M000090.html +23 -0
- data/doc/classes/LongDecimal.src/M000091.html +23 -0
- data/doc/classes/LongDecimal.src/M000092.html +19 -0
- data/doc/classes/LongDecimal.src/M000093.html +23 -0
- data/doc/classes/LongDecimal.src/M000094.html +18 -0
- data/doc/classes/LongDecimal.src/M000095.html +30 -0
- data/doc/classes/LongDecimal.src/M000096.html +18 -0
- data/doc/classes/LongDecimal.src/M000097.html +18 -0
- data/doc/classes/LongDecimal.src/M000098.html +18 -0
- data/doc/classes/LongDecimal.src/M000099.html +23 -0
- data/doc/classes/LongDecimal.src/M000100.html +19 -0
- data/doc/classes/LongDecimal.src/M000101.html +18 -0
- data/doc/classes/LongDecimal.src/M000102.html +45 -0
- data/doc/classes/LongDecimal.src/M000103.html +18 -0
- data/doc/classes/LongDecimal.src/M000104.html +18 -0
- data/doc/classes/LongDecimal.src/M000107.html +18 -0
- data/doc/classes/LongDecimal.src/M000108.html +18 -0
- data/doc/classes/LongDecimal.src/M000109.html +18 -0
- data/doc/classes/LongDecimal.src/M000110.html +18 -0
- data/doc/classes/LongDecimalQuot.html +757 -0
- data/doc/classes/LongDecimalQuot.src/M000003.html +18 -0
- data/doc/classes/LongDecimalQuot.src/M000004.html +28 -0
- data/doc/classes/LongDecimalQuot.src/M000005.html +18 -0
- data/doc/classes/LongDecimalQuot.src/M000006.html +18 -0
- data/doc/classes/LongDecimalQuot.src/M000007.html +18 -0
- data/doc/classes/LongDecimalQuot.src/M000008.html +18 -0
- data/doc/classes/LongDecimalQuot.src/M000009.html +19 -0
- data/doc/classes/LongDecimalQuot.src/M000010.html +18 -0
- data/doc/classes/LongDecimalQuot.src/M000011.html +18 -0
- data/doc/classes/LongDecimalQuot.src/M000012.html +18 -0
- data/doc/classes/LongDecimalQuot.src/M000013.html +18 -0
- data/doc/classes/LongDecimalQuot.src/M000014.html +18 -0
- data/doc/classes/LongDecimalQuot.src/M000015.html +22 -0
- data/doc/classes/LongDecimalQuot.src/M000016.html +23 -0
- data/doc/classes/LongDecimalQuot.src/M000017.html +23 -0
- data/doc/classes/LongDecimalQuot.src/M000018.html +23 -0
- data/doc/classes/LongDecimalQuot.src/M000019.html +23 -0
- data/doc/classes/LongDecimalQuot.src/M000020.html +35 -0
- data/doc/classes/LongDecimalQuot.src/M000021.html +22 -0
- data/doc/classes/LongDecimalQuot.src/M000022.html +19 -0
- data/doc/classes/LongDecimalQuot.src/M000023.html +18 -0
- data/doc/classes/LongDecimalQuot.src/M000024.html +18 -0
- data/doc/classes/LongDecimalQuot.src/M000025.html +18 -0
- data/doc/classes/LongDecimalQuot.src/M000026.html +18 -0
- data/doc/classes/LongDecimalQuot.src/M000027.html +79 -0
- data/doc/classes/LongDecimalQuot.src/M000028.html +36 -0
- data/doc/classes/LongDecimalQuot.src/M000029.html +18 -0
- data/doc/classes/LongDecimalQuot.src/M000030.html +23 -0
- data/doc/classes/LongDecimalQuot.src/M000031.html +19 -0
- data/doc/classes/LongDecimalQuot.src/M000032.html +18 -0
- data/doc/classes/LongDecimalQuot.src/M000033.html +18 -0
- data/doc/classes/LongDecimalQuot.src/M000034.html +18 -0
- data/doc/classes/LongDecimalQuot.src/M000037.html +18 -0
- data/doc/classes/LongDecimalQuot.src/M000038.html +18 -0
- data/doc/classes/LongDecimalQuot.src/M000039.html +18 -0
- data/doc/classes/LongDecimalRoundingMode.html +185 -0
- data/doc/classes/LongDecimalRoundingMode/RoundingModeClass.html +155 -0
- data/doc/classes/LongDecimalRoundingMode/RoundingModeClass.src/M000122.html +22 -0
- data/doc/classes/LongMath.html +468 -0
- data/doc/classes/LongMath.src/M000112.html +19 -0
- data/doc/classes/LongMath.src/M000113.html +18 -0
- data/doc/classes/LongMath.src/M000114.html +18 -0
- data/doc/classes/LongMath.src/M000115.html +19 -0
- data/doc/classes/LongMath.src/M000116.html +18 -0
- data/doc/classes/LongMath.src/M000117.html +32 -0
- data/doc/classes/LongMath.src/M000118.html +32 -0
- data/doc/classes/LongMath.src/M000119.html +19 -0
- data/doc/classes/LongMath.src/M000120.html +43 -0
- data/doc/classes/LongMath.src/M000121.html +19 -0
- data/doc/classes/Numeric.html +149 -0
- data/doc/classes/Numeric.src/M000111.html +18 -0
- data/doc/created.rid +1 -0
- data/doc/dot/f_0.dot +113 -0
- data/doc/dot/f_0.png +0 -0
- data/doc/dot/m_0_0.dot +40 -0
- data/doc/dot/m_0_0.png +0 -0
- data/doc/dot/m_0_1.dot +49 -0
- data/doc/dot/m_0_1.png +0 -0
- data/doc/files/lib/longdecimal_rb.html +180 -0
- data/doc/files/lib/longdecimal_rb.src/M000001.html +22 -0
- data/doc/files/lib/longdecimal_rb.src/M000002.html +18 -0
- data/doc/fr_class_index.html +32 -0
- data/doc/fr_file_index.html +27 -0
- data/doc/fr_method_index.html +154 -0
- data/doc/index.html +24 -0
- data/doc/rdoc-style.css +208 -0
- data/lib/longdecimal.rb +216 -48
- data/test/testlongdecimal.rb +112 -24
- metadata +149 -2
@@ -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>new! (LongDecimalQuot)</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/longdecimal.rb, line 1338</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">LongDecimalQuot</span>.<span class="ruby-identifier">new!</span>(<span class="ruby-identifier">first</span>, <span class="ruby-identifier">second</span>)
|
15
|
+
<span class="ruby-identifier">new</span>(<span class="ruby-identifier">first</span>, <span class="ruby-identifier">second</span>)
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,28 @@
|
|
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>new (LongDecimalQuot)</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/longdecimal.rb, line 1345</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">first</span>, <span class="ruby-identifier">second</span>)
|
15
|
+
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">first</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Rational</span>) <span class="ruby-operator">&&</span> (<span class="ruby-identifier">second</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Integer</span>) <span class="ruby-keyword kw">then</span>
|
16
|
+
<span class="ruby-ivar">@rat</span> = <span class="ruby-constant">Rational</span>(<span class="ruby-identifier">first</span>.<span class="ruby-identifier">numerator</span>, <span class="ruby-identifier">first</span>.<span class="ruby-identifier">denominator</span>)
|
17
|
+
<span class="ruby-ivar">@scale</span> = <span class="ruby-identifier">second</span>
|
18
|
+
<span class="ruby-keyword kw">elsif</span> (<span class="ruby-identifier">first</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">LongDecimal</span>) <span class="ruby-operator">&&</span> (<span class="ruby-identifier">second</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">LongDecimal</span>) <span class="ruby-keyword kw">then</span>
|
19
|
+
<span class="ruby-identifier">orig_scale</span> = <span class="ruby-identifier">first</span>.<span class="ruby-identifier">scale</span>
|
20
|
+
<span class="ruby-identifier">first</span>, <span class="ruby-identifier">second</span> = <span class="ruby-identifier">first</span>.<span class="ruby-identifier">anti_equalize_scale</span>(<span class="ruby-identifier">second</span>)
|
21
|
+
<span class="ruby-ivar">@rat</span> = <span class="ruby-constant">Rational</span>(<span class="ruby-identifier">first</span>.<span class="ruby-identifier">to_i</span>, <span class="ruby-identifier">second</span>.<span class="ruby-identifier">to_i</span>)
|
22
|
+
<span class="ruby-ivar">@scale</span> = <span class="ruby-identifier">orig_scale</span>
|
23
|
+
<span class="ruby-keyword kw">else</span>
|
24
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-node">"parameters must be (LongDecimal, LongDecimal) or (Rational, Integer): first=#{first.inspect} second=#{second.inspect}"</span>;
|
25
|
+
<span class="ruby-keyword kw">end</span>
|
26
|
+
<span class="ruby-keyword kw">end</span></pre>
|
27
|
+
</body>
|
28
|
+
</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>scale (LongDecimalQuot)</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/longdecimal.rb, line 1360</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">scale</span>
|
15
|
+
<span class="ruby-ivar">@scale</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>rat (LongDecimalQuot)</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/longdecimal.rb, line 1364</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rat</span>
|
15
|
+
<span class="ruby-ivar">@rat</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>numerator (LongDecimalQuot)</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/longdecimal.rb, line 1368</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">numerator</span>
|
15
|
+
<span class="ruby-identifier">rat</span>.<span class="ruby-identifier">numerator</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>denominator (LongDecimalQuot)</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/longdecimal.rb, line 1372</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">denominator</span>
|
15
|
+
<span class="ruby-identifier">rat</span>.<span class="ruby-identifier">denominator</span>
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
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>to_s (LongDecimalQuot)</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/longdecimal.rb, line 1385</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
|
15
|
+
<span class="ruby-identifier">str</span> = <span class="ruby-ivar">@rat</span>.<span class="ruby-identifier">to_s</span>
|
16
|
+
<span class="ruby-identifier">str</span> <span class="ruby-operator">+</span> <span class="ruby-value str">"["</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">scale</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-value str">"]"</span>
|
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>to_r (LongDecimalQuot)</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/longdecimal.rb, line 1390</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_r</span>
|
15
|
+
<span class="ruby-constant">Rational</span>(<span class="ruby-identifier">numerator</span>, <span class="ruby-identifier">denominator</span>)
|
16
|
+
<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>to_f (LongDecimalQuot)</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/longdecimal.rb, line 1395</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_f</span>
|
15
|
+
<span class="ruby-identifier">to_r</span>.<span class="ruby-identifier">to_f</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>to_i (LongDecimalQuot)</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/longdecimal.rb, line 1400</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_i</span>
|
15
|
+
<span class="ruby-identifier">to_r</span>.<span class="ruby-identifier">to_i</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>to_ld (LongDecimalQuot)</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/longdecimal.rb, line 1404</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_ld</span>
|
15
|
+
<span class="ruby-constant">LongDecimal</span>(<span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">scale</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>+@ (LongDecimalQuot)</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/longdecimal.rb, line 1408</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">+@</span>
|
15
|
+
<span class="ruby-keyword kw">self</span>
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,22 @@
|
|
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>-@ (LongDecimalQuot)</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/longdecimal.rb, line 1412</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">-@</span>
|
15
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">zero?</span> <span class="ruby-keyword kw">then</span>
|
16
|
+
<span class="ruby-keyword kw">self</span>
|
17
|
+
<span class="ruby-keyword kw">else</span>
|
18
|
+
<span class="ruby-constant">LongDecimalQuot</span>(<span class="ruby-operator">-</span><span class="ruby-identifier">rat</span>, <span class="ruby-identifier">scale</span>)
|
19
|
+
<span class="ruby-keyword kw">end</span>
|
20
|
+
<span class="ruby-keyword kw">end</span></pre>
|
21
|
+
</body>
|
22
|
+
</html>
|
@@ -0,0 +1,23 @@
|
|
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>+ (LongDecimalQuot)</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/longdecimal.rb, line 1420</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">+</span>(<span class="ruby-identifier">other</span>)
|
15
|
+
<span class="ruby-identifier">o</span>, <span class="ruby-identifier">s</span> = <span class="ruby-identifier">coerce</span>(<span class="ruby-identifier">other</span>)
|
16
|
+
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">s</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">LongDecimalQuot</span>) <span class="ruby-keyword kw">then</span>
|
17
|
+
<span class="ruby-constant">LongDecimalQuot</span>(<span class="ruby-identifier">s</span>.<span class="ruby-identifier">rat</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">o</span>.<span class="ruby-identifier">rat</span>, [<span class="ruby-identifier">s</span>.<span class="ruby-identifier">scale</span>, <span class="ruby-identifier">o</span>.<span class="ruby-identifier">scale</span>].<span class="ruby-identifier">max</span>)
|
18
|
+
<span class="ruby-keyword kw">else</span>
|
19
|
+
<span class="ruby-identifier">s</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">o</span>
|
20
|
+
<span class="ruby-keyword kw">end</span>
|
21
|
+
<span class="ruby-keyword kw">end</span></pre>
|
22
|
+
</body>
|
23
|
+
</html>
|
@@ -0,0 +1,23 @@
|
|
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>- (LongDecimalQuot)</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/longdecimal.rb, line 1429</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">-</span>(<span class="ruby-identifier">other</span>)
|
15
|
+
<span class="ruby-identifier">o</span>, <span class="ruby-identifier">s</span> = <span class="ruby-identifier">coerce</span>(<span class="ruby-identifier">other</span>)
|
16
|
+
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">s</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">LongDecimalQuot</span>) <span class="ruby-keyword kw">then</span>
|
17
|
+
<span class="ruby-constant">LongDecimalQuot</span>(<span class="ruby-identifier">s</span>.<span class="ruby-identifier">rat</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">o</span>.<span class="ruby-identifier">rat</span>, [<span class="ruby-identifier">s</span>.<span class="ruby-identifier">scale</span>, <span class="ruby-identifier">o</span>.<span class="ruby-identifier">scale</span>].<span class="ruby-identifier">max</span>)
|
18
|
+
<span class="ruby-keyword kw">else</span>
|
19
|
+
<span class="ruby-identifier">s</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">o</span>
|
20
|
+
<span class="ruby-keyword kw">end</span>
|
21
|
+
<span class="ruby-keyword kw">end</span></pre>
|
22
|
+
</body>
|
23
|
+
</html>
|
@@ -0,0 +1,23 @@
|
|
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>* (LongDecimalQuot)</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/longdecimal.rb, line 1438</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">*</span>(<span class="ruby-identifier">other</span>)
|
15
|
+
<span class="ruby-identifier">o</span>, <span class="ruby-identifier">s</span> = <span class="ruby-identifier">coerce</span>(<span class="ruby-identifier">other</span>)
|
16
|
+
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">s</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">LongDecimalQuot</span>) <span class="ruby-keyword kw">then</span>
|
17
|
+
<span class="ruby-constant">LongDecimalQuot</span>(<span class="ruby-identifier">s</span>.<span class="ruby-identifier">rat</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">o</span>.<span class="ruby-identifier">rat</span>, <span class="ruby-identifier">s</span>.<span class="ruby-identifier">scale</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">o</span>.<span class="ruby-identifier">scale</span>)
|
18
|
+
<span class="ruby-keyword kw">else</span>
|
19
|
+
<span class="ruby-identifier">s</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">o</span>
|
20
|
+
<span class="ruby-keyword kw">end</span>
|
21
|
+
<span class="ruby-keyword kw">end</span></pre>
|
22
|
+
</body>
|
23
|
+
</html>
|
@@ -0,0 +1,23 @@
|
|
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>/ (LongDecimalQuot)</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/longdecimal.rb, line 1447</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">/</span>(<span class="ruby-identifier">other</span>)
|
15
|
+
<span class="ruby-identifier">o</span>, <span class="ruby-identifier">s</span> = <span class="ruby-identifier">coerce</span>(<span class="ruby-identifier">other</span>)
|
16
|
+
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">s</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">LongDecimalQuot</span>) <span class="ruby-keyword kw">then</span>
|
17
|
+
<span class="ruby-constant">LongDecimalQuot</span>(<span class="ruby-identifier">s</span>.<span class="ruby-identifier">rat</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">o</span>.<span class="ruby-identifier">rat</span>, <span class="ruby-identifier">scale</span>)
|
18
|
+
<span class="ruby-keyword kw">else</span>
|
19
|
+
<span class="ruby-identifier">s</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">o</span>
|
20
|
+
<span class="ruby-keyword kw">end</span>
|
21
|
+
<span class="ruby-keyword kw">end</span></pre>
|
22
|
+
</body>
|
23
|
+
</html>
|
@@ -0,0 +1,35 @@
|
|
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>** (LongDecimalQuot)</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/longdecimal.rb, line 1456</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">**</span>(<span class="ruby-identifier">other</span>)
|
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">LongDecimal</span>) <span class="ruby-operator">||</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>
|
16
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">is_int?</span> <span class="ruby-keyword kw">then</span>
|
17
|
+
<span class="ruby-identifier">other</span> = <span class="ruby-identifier">other</span>.<span class="ruby-identifier">to_i</span>
|
18
|
+
<span class="ruby-keyword kw">else</span>
|
19
|
+
<span class="ruby-identifier">other</span> = <span class="ruby-identifier">other</span>.<span class="ruby-identifier">to_r</span>
|
20
|
+
<span class="ruby-keyword kw">end</span>
|
21
|
+
<span class="ruby-keyword kw">end</span>
|
22
|
+
<span class="ruby-identifier">rat_result</span> = <span class="ruby-identifier">rat</span> <span class="ruby-operator">**</span> <span class="ruby-identifier">other</span>
|
23
|
+
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">rat_result</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Rational</span>) <span class="ruby-keyword kw">then</span>
|
24
|
+
<span class="ruby-keyword kw">if</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-operator">>=</span> <span class="ruby-value">0</span> <span class="ruby-keyword kw">then</span>
|
25
|
+
<span class="ruby-identifier">new_scale</span> = <span class="ruby-identifier">scale</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">other</span>
|
26
|
+
<span class="ruby-keyword kw">else</span>
|
27
|
+
<span class="ruby-identifier">new_scale</span> = <span class="ruby-identifier">scale</span>
|
28
|
+
<span class="ruby-keyword kw">end</span>
|
29
|
+
<span class="ruby-constant">LongDecimalQuot</span>(<span class="ruby-identifier">rat_result</span>, <span class="ruby-identifier">new_scale</span>)
|
30
|
+
<span class="ruby-keyword kw">else</span>
|
31
|
+
<span class="ruby-identifier">rat_result</span>
|
32
|
+
<span class="ruby-keyword kw">end</span>
|
33
|
+
<span class="ruby-keyword kw">end</span></pre>
|
34
|
+
</body>
|
35
|
+
</html>
|
@@ -0,0 +1,22 @@
|
|
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>divmod (LongDecimalQuot)</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/longdecimal.rb, line 1477</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">divmod</span>(<span class="ruby-identifier">other</span>)
|
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
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-value str">"divmod not supported for Complex"</span>
|
17
|
+
<span class="ruby-keyword kw">end</span>
|
18
|
+
<span class="ruby-identifier">q</span> = (<span class="ruby-keyword kw">self</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">other</span>).<span class="ruby-identifier">to_i</span>
|
19
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">q</span>, <span class="ruby-keyword kw">self</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">other</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">q</span>
|
20
|
+
<span class="ruby-keyword kw">end</span></pre>
|
21
|
+
</body>
|
22
|
+
</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>% (LongDecimalQuot)</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/longdecimal.rb, line 1485</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">%</span>(<span class="ruby-identifier">other</span>)
|
15
|
+
<span class="ruby-identifier">q</span>, <span class="ruby-identifier">r</span> = <span class="ruby-identifier">divmod</span> <span class="ruby-identifier">other</span>
|
16
|
+
<span class="ruby-identifier">r</span>
|
17
|
+
<span class="ruby-keyword kw">end</span></pre>
|
18
|
+
</body>
|
19
|
+
</html>
|