long-decimal 0.00.10 → 0.00.11
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/VERSION +1 -1
- data/doc/classes/LongDecimalRoundingMode/RoundingModeClass.html +12 -5
- data/doc/classes/LongDecimalRoundingMode/RoundingModeClass.src/M000136.html +22 -0
- data/doc/classes/LongMath/LongDecimal.html +1624 -0
- data/doc/classes/LongMath/LongDecimal.src/M000061.html +18 -0
- data/doc/classes/LongMath/LongDecimal.src/M000062.html +18 -0
- data/doc/classes/LongMath/LongDecimal.src/M000063.html +18 -0
- data/doc/classes/LongMath/LongDecimal.src/M000064.html +20 -0
- data/doc/classes/LongMath/LongDecimal.src/M000065.html +109 -0
- data/doc/classes/LongMath/LongDecimal.src/M000066.html +34 -0
- data/doc/classes/LongMath/LongDecimal.src/M000067.html +41 -0
- data/doc/classes/LongMath/LongDecimal.src/M000068.html +35 -0
- data/doc/classes/LongMath/LongDecimal.src/M000069.html +18 -0
- data/doc/classes/LongMath/LongDecimal.src/M000070.html +29 -0
- data/doc/classes/LongMath/LongDecimal.src/M000071.html +18 -0
- data/doc/classes/LongMath/LongDecimal.src/M000072.html +38 -0
- data/doc/classes/LongMath/LongDecimal.src/M000073.html +18 -0
- data/doc/classes/LongMath/LongDecimal.src/M000074.html +18 -0
- data/doc/classes/LongMath/LongDecimal.src/M000075.html +20 -0
- data/doc/classes/LongMath/LongDecimal.src/M000076.html +18 -0
- data/doc/classes/LongMath/LongDecimal.src/M000077.html +29 -0
- data/doc/classes/LongMath/LongDecimal.src/M000078.html +46 -0
- data/doc/classes/LongMath/LongDecimal.src/M000079.html +29 -0
- data/doc/classes/LongMath/LongDecimal.src/M000080.html +27 -0
- data/doc/classes/LongMath/LongDecimal.src/M000081.html +18 -0
- data/doc/classes/LongMath/LongDecimal.src/M000083.html +18 -0
- data/doc/classes/LongMath/LongDecimal.src/M000084.html +18 -0
- data/doc/classes/LongMath/LongDecimal.src/M000085.html +18 -0
- data/doc/classes/LongMath/LongDecimal.src/M000086.html +18 -0
- data/doc/classes/LongMath/LongDecimal.src/M000087.html +18 -0
- data/doc/classes/LongMath/LongDecimal.src/M000089.html +18 -0
- data/doc/classes/LongMath/LongDecimal.src/M000090.html +22 -0
- data/doc/classes/LongMath/LongDecimal.src/M000091.html +23 -0
- data/doc/classes/LongMath/LongDecimal.src/M000092.html +23 -0
- data/doc/classes/LongMath/LongDecimal.src/M000093.html +23 -0
- data/doc/classes/LongMath/LongDecimal.src/M000094.html +18 -0
- data/doc/classes/LongMath/LongDecimal.src/M000095.html +29 -0
- data/doc/classes/LongMath/LongDecimal.src/M000096.html +23 -0
- data/doc/classes/LongMath/LongDecimal.src/M000097.html +23 -0
- data/doc/classes/LongMath/LongDecimal.src/M000098.html +34 -0
- data/doc/classes/LongMath/LongDecimal.src/M000099.html +22 -0
- data/doc/classes/LongMath/LongDecimal.src/M000100.html +19 -0
- data/doc/classes/LongMath/LongDecimal.src/M000101.html +23 -0
- data/doc/classes/LongMath/LongDecimal.src/M000102.html +23 -0
- data/doc/classes/LongMath/LongDecimal.src/M000103.html +23 -0
- data/doc/classes/LongMath/LongDecimal.src/M000104.html +18 -0
- data/doc/classes/LongMath/LongDecimal.src/M000105.html +21 -0
- data/doc/classes/LongMath/LongDecimal.src/M000106.html +21 -0
- data/doc/classes/LongMath/LongDecimal.src/M000107.html +18 -0
- data/doc/classes/LongMath/LongDecimal.src/M000108.html +18 -0
- data/doc/classes/LongMath/LongDecimal.src/M000109.html +23 -0
- data/doc/classes/LongMath/LongDecimal.src/M000110.html +23 -0
- data/doc/classes/LongMath/LongDecimal.src/M000111.html +19 -0
- data/doc/classes/LongMath/LongDecimal.src/M000112.html +23 -0
- data/doc/classes/LongMath/LongDecimal.src/M000113.html +18 -0
- data/doc/classes/LongMath/LongDecimal.src/M000114.html +30 -0
- data/doc/classes/LongMath/LongDecimal.src/M000115.html +18 -0
- data/doc/classes/LongMath/LongDecimal.src/M000116.html +23 -0
- data/doc/classes/LongMath/LongDecimal.src/M000117.html +18 -0
- data/doc/classes/LongMath/LongDecimal.src/M000118.html +30 -0
- data/doc/classes/LongMath/LongDecimal.src/M000119.html +23 -0
- data/doc/classes/LongMath/LongDecimal.src/M000120.html +19 -0
- data/doc/classes/LongMath/LongDecimal.src/M000121.html +18 -0
- data/doc/classes/LongMath/LongDecimal.src/M000122.html +47 -0
- data/doc/classes/LongMath/LongDecimal.src/M000123.html +18 -0
- data/doc/classes/LongMath/LongDecimal.src/M000124.html +18 -0
- data/doc/classes/LongMath/LongDecimal.src/M000125.html +47 -0
- data/doc/classes/LongMath/LongDecimal.src/M000126.html +18 -0
- data/doc/classes/LongMath/LongDecimal.src/M000127.html +19 -0
- data/doc/classes/LongMath/LongDecimal.src/M000130.html +18 -0
- data/doc/classes/LongMath/LongDecimal.src/M000131.html +18 -0
- data/doc/classes/LongMath/LongDecimal.src/M000132.html +18 -0
- data/doc/classes/LongMath/LongDecimal.src/M000133.html +18 -0
- data/doc/classes/LongMath/LongDecimal.src/M000134.html +18 -0
- data/doc/classes/LongMath/LongDecimalQuot.html +797 -0
- data/doc/classes/LongMath/LongDecimalQuot.src/M000024.html +18 -0
- data/doc/classes/LongMath/LongDecimalQuot.src/M000025.html +28 -0
- data/doc/classes/LongMath/LongDecimalQuot.src/M000026.html +18 -0
- data/doc/classes/LongMath/LongDecimalQuot.src/M000027.html +18 -0
- data/doc/classes/LongMath/LongDecimalQuot.src/M000028.html +19 -0
- data/doc/classes/LongMath/LongDecimalQuot.src/M000029.html +18 -0
- data/doc/classes/LongMath/LongDecimalQuot.src/M000030.html +18 -0
- data/doc/classes/LongMath/LongDecimalQuot.src/M000031.html +18 -0
- data/doc/classes/LongMath/LongDecimalQuot.src/M000032.html +18 -0
- data/doc/classes/LongMath/LongDecimalQuot.src/M000033.html +18 -0
- data/doc/classes/LongMath/LongDecimalQuot.src/M000034.html +22 -0
- data/doc/classes/LongMath/LongDecimalQuot.src/M000035.html +23 -0
- data/doc/classes/LongMath/LongDecimalQuot.src/M000036.html +23 -0
- data/doc/classes/LongMath/LongDecimalQuot.src/M000037.html +23 -0
- data/doc/classes/LongMath/LongDecimalQuot.src/M000038.html +23 -0
- data/doc/classes/LongMath/LongDecimalQuot.src/M000039.html +35 -0
- data/doc/classes/LongMath/LongDecimalQuot.src/M000040.html +22 -0
- data/doc/classes/LongMath/LongDecimalQuot.src/M000041.html +19 -0
- data/doc/classes/LongMath/LongDecimalQuot.src/M000042.html +18 -0
- data/doc/classes/LongMath/LongDecimalQuot.src/M000043.html +18 -0
- data/doc/classes/LongMath/LongDecimalQuot.src/M000044.html +18 -0
- data/doc/classes/LongMath/LongDecimalQuot.src/M000045.html +18 -0
- data/doc/classes/LongMath/LongDecimalQuot.src/M000046.html +77 -0
- data/doc/classes/LongMath/LongDecimalQuot.src/M000047.html +36 -0
- data/doc/classes/LongMath/LongDecimalQuot.src/M000048.html +18 -0
- data/doc/classes/LongMath/LongDecimalQuot.src/M000049.html +23 -0
- data/doc/classes/LongMath/LongDecimalQuot.src/M000050.html +19 -0
- data/doc/classes/LongMath/LongDecimalQuot.src/M000051.html +18 -0
- data/doc/classes/LongMath/LongDecimalQuot.src/M000052.html +18 -0
- data/doc/classes/LongMath/LongDecimalQuot.src/M000053.html +18 -0
- data/doc/classes/LongMath/LongDecimalQuot.src/M000054.html +18 -0
- data/doc/classes/LongMath/LongDecimalQuot.src/M000055.html +18 -0
- data/doc/classes/LongMath/LongDecimalQuot.src/M000058.html +18 -0
- data/doc/classes/LongMath/LongDecimalQuot.src/M000059.html +18 -0
- data/doc/classes/LongMath/LongDecimalQuot.src/M000060.html +18 -0
- data/doc/classes/LongMath/Numeric.html +150 -0
- data/doc/classes/LongMath/Numeric.src/M000135.html +18 -0
- data/doc/classes/LongMath.html +70 -37
- data/doc/classes/LongMath.src/M000001.html +19 -0
- data/doc/classes/LongMath.src/M000002.html +18 -0
- data/doc/classes/LongMath.src/M000003.html +18 -0
- data/doc/classes/LongMath.src/M000004.html +19 -0
- data/doc/classes/LongMath.src/M000005.html +18 -0
- data/doc/classes/LongMath.src/M000006.html +32 -0
- data/doc/classes/LongMath.src/M000007.html +32 -0
- data/doc/classes/LongMath.src/M000008.html +19 -0
- data/doc/classes/LongMath.src/M000009.html +43 -0
- data/doc/classes/LongMath.src/M000010.html +19 -0
- data/doc/classes/LongMath.src/M000011.html +73 -0
- data/doc/classes/LongMath.src/M000012.html +35 -0
- data/doc/classes/LongMath.src/M000013.html +50 -0
- data/doc/classes/LongMath.src/M000014.html +47 -0
- data/doc/classes/LongMath.src/M000015.html +22 -0
- data/doc/classes/LongMath.src/M000016.html +25 -0
- data/doc/classes/LongMath.src/M000017.html +107 -0
- data/doc/classes/LongMath.src/M000018.html +21 -0
- data/doc/classes/LongMath.src/M000019.html +30 -0
- data/doc/classes/LongMath.src/M000020.html +30 -0
- data/doc/classes/LongMath.src/M000021.html +115 -0
- data/doc/classes/LongMath.src/M000022.html +22 -0
- data/doc/classes/LongMath.src/M000023.html +18 -0
- data/doc/created.rid +1 -1
- data/doc/files/lib/longdecimal_rb.html +2 -2
- data/doc/fr_method_index.html +108 -111
- data/lib/longdecimal.rb +333 -93
- metadata +139 -2
@@ -0,0 +1,1624 @@
|
|
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 xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: LongMath::LongDecimal</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">LongMath::LongDecimal</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/lib/longdecimal_rb.html">
|
59
|
+
lib/longdecimal.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
<a href="Numeric.html">
|
69
|
+
Numeric
|
70
|
+
</a>
|
71
|
+
</td>
|
72
|
+
</tr>
|
73
|
+
</table>
|
74
|
+
</div>
|
75
|
+
<!-- banner header -->
|
76
|
+
|
77
|
+
<div id="bodyContent">
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
<div id="contextContent">
|
82
|
+
<div id="diagram">
|
83
|
+
<map id="map" name="map">
|
84
|
+
<area shape="RECT" coords="40,6,195,54" href="../LongDecimalRoundingMode.html" alt="LongDecimalRoundingMode">
|
85
|
+
<area shape="RECT" coords="27,198,141,246" href="LongDecimalQuot.html" alt="LongDecimalQuot">
|
86
|
+
<area shape="RECT" coords="165,198,259,246" href="LongDecimal.html" alt="LongDecimal">
|
87
|
+
<area shape="RECT" coords="181,102,253,150" href="Numeric.html" alt="Numeric">
|
88
|
+
<area shape="RECT" coords="16,68,269,256" href="../LongMath.html" alt="LongMath">
|
89
|
+
</map>
|
90
|
+
<img src="../../dot/m_0_0.png" usemap="#map" border=0 alt="Module: LongMath">
|
91
|
+
</div>
|
92
|
+
|
93
|
+
<div id="description">
|
94
|
+
<p>
|
95
|
+
class for holding fixed point long decimal numbers these can be considered
|
96
|
+
as a pair of two integer. One contains the digits and the other one the
|
97
|
+
position of the decimal point.
|
98
|
+
</p>
|
99
|
+
|
100
|
+
</div>
|
101
|
+
|
102
|
+
|
103
|
+
</div>
|
104
|
+
|
105
|
+
<div id="method-list">
|
106
|
+
<h3 class="section-bar">Methods</h3>
|
107
|
+
|
108
|
+
<div class="name-list">
|
109
|
+
<a href="#M000100">%</a>
|
110
|
+
<a href="#M000101">&</a>
|
111
|
+
<a href="#M000093">*</a>
|
112
|
+
<a href="#M000098">**</a>
|
113
|
+
<a href="#M000091">+</a>
|
114
|
+
<a href="#M000089">+@</a>
|
115
|
+
<a href="#M000092">-</a>
|
116
|
+
<a href="#M000090">-@</a>
|
117
|
+
<a href="#M000097">/</a>
|
118
|
+
<a href="#M000105"><<</a>
|
119
|
+
<a href="#M000119"><=></a>
|
120
|
+
<a href="#M000127">==</a>
|
121
|
+
<a href="#M000106">>></a>
|
122
|
+
<a href="#M000107">[]</a>
|
123
|
+
<a href="#M000103">^</a>
|
124
|
+
<a href="#M000117">abs</a>
|
125
|
+
<a href="#M000118">abs2</a>
|
126
|
+
<a href="#M000080">anti_equalize_scale</a>
|
127
|
+
<a href="#M000122">coerce</a>
|
128
|
+
<a href="#M000085">dec</a>
|
129
|
+
<a href="#M000087">dec!</a>
|
130
|
+
<a href="#M000076">denominator</a>
|
131
|
+
<a href="#M000094">divide</a>
|
132
|
+
<a href="#M000095">divide_s</a>
|
133
|
+
<a href="#M000099">divmod</a>
|
134
|
+
<a href="#M000079">equalize_scale</a>
|
135
|
+
<a href="#M000130">hash</a>
|
136
|
+
<a href="#M000084">inc</a>
|
137
|
+
<a href="#M000086">inc!</a>
|
138
|
+
<a href="#M000131">inspect</a>
|
139
|
+
<a href="#M000078">int_digits10</a>
|
140
|
+
<a href="#M000077">int_digits2</a>
|
141
|
+
<a href="#M000116">inverse</a>
|
142
|
+
<a href="#M000123">is_int?</a>
|
143
|
+
<a href="#M000063">minus_one!</a>
|
144
|
+
<a href="#M000109">move_point_left</a>
|
145
|
+
<a href="#M000111">move_point_left_int</a>
|
146
|
+
<a href="#M000110">move_point_right</a>
|
147
|
+
<a href="#M000112">move_point_right_int</a>
|
148
|
+
<a href="#M000065">new</a>
|
149
|
+
<a href="#M000058">new!</a>
|
150
|
+
<a href="#M000082">next</a>
|
151
|
+
<a href="#M000060">one!</a>
|
152
|
+
<a href="#M000129">one?</a>
|
153
|
+
<a href="#M000064">power_of_ten!</a>
|
154
|
+
<a href="#M000083">pred</a>
|
155
|
+
<a href="#M000096">rdiv</a>
|
156
|
+
<a href="#M000115">reciprocal</a>
|
157
|
+
<a href="#M000067">round_to_scale</a>
|
158
|
+
<a href="#M000066">scale=</a>
|
159
|
+
<a href="#M000121">scale_equal</a>
|
160
|
+
<a href="#M000120">scale_ufo</a>
|
161
|
+
<a href="#M000124">sgn</a>
|
162
|
+
<a href="#M000126">sign</a>
|
163
|
+
<a href="#M000125">signum</a>
|
164
|
+
<a href="#M000108">size</a>
|
165
|
+
<a href="#M000114">sqrt</a>
|
166
|
+
<a href="#M000113">square</a>
|
167
|
+
<a href="#M000081">succ</a>
|
168
|
+
<a href="#M000062">ten!</a>
|
169
|
+
<a href="#M000075">to_bd</a>
|
170
|
+
<a href="#M000072">to_f</a>
|
171
|
+
<a href="#M000073">to_i</a>
|
172
|
+
<a href="#M000074">to_ld</a>
|
173
|
+
<a href="#M000071">to_r</a>
|
174
|
+
<a href="#M000068">to_s</a>
|
175
|
+
<a href="#M000069">to_s_10</a>
|
176
|
+
<a href="#M000070">to_s_internal</a>
|
177
|
+
<a href="#M000061">two!</a>
|
178
|
+
<a href="#M000088">unit</a>
|
179
|
+
<a href="#M000059">zero!</a>
|
180
|
+
<a href="#M000128">zero?</a>
|
181
|
+
<a href="#M000102">|</a>
|
182
|
+
<a href="#M000104">~</a>
|
183
|
+
</div>
|
184
|
+
</div>
|
185
|
+
|
186
|
+
</div>
|
187
|
+
|
188
|
+
|
189
|
+
<!-- if includes -->
|
190
|
+
<div id="includes">
|
191
|
+
<h3 class="section-bar">Included Modules</h3>
|
192
|
+
|
193
|
+
<div id="includes-list">
|
194
|
+
<span class="include-name"><a href="../LongDecimalRoundingMode.html">LongDecimalRoundingMode</a></span>
|
195
|
+
</div>
|
196
|
+
</div>
|
197
|
+
|
198
|
+
<div id="section">
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
<div id="aliases-list">
|
203
|
+
<h3 class="section-bar">External Aliases</h3>
|
204
|
+
|
205
|
+
<div class="name-list">
|
206
|
+
<table summary="aliases">
|
207
|
+
<tr class="top-aligned-row context-row">
|
208
|
+
<td class="context-item-name">int_val</td>
|
209
|
+
<td>-></td>
|
210
|
+
<td class="context-item-value">numerator</td>
|
211
|
+
</tr>
|
212
|
+
<tr class="top-aligned-row context-row">
|
213
|
+
<td> </td>
|
214
|
+
<td colspan="2" class="context-item-desc">
|
215
|
+
LongDecimals can be seen as a fraction with its int_val as its numerator
|
216
|
+
Please observe that there may be common factors of numerator and
|
217
|
+
denominator in case of <a href="LongDecimal.html">LongDecimal</a>, which
|
218
|
+
does not occur in case of Rational
|
219
|
+
|
220
|
+
</td>
|
221
|
+
</tr>
|
222
|
+
</table>
|
223
|
+
</div>
|
224
|
+
</div>
|
225
|
+
|
226
|
+
|
227
|
+
<div id="attribute-list">
|
228
|
+
<h3 class="section-bar">Attributes</h3>
|
229
|
+
|
230
|
+
<div class="name-list">
|
231
|
+
<table>
|
232
|
+
<tr class="top-aligned-row context-row">
|
233
|
+
<td class="context-item-name">int_val</td>
|
234
|
+
<td class="context-item-value"> [R] </td>
|
235
|
+
<td class="context-item-desc"></td>
|
236
|
+
</tr>
|
237
|
+
<tr class="top-aligned-row context-row">
|
238
|
+
<td class="context-item-name">scale</td>
|
239
|
+
<td class="context-item-value"> [R] </td>
|
240
|
+
<td class="context-item-desc"></td>
|
241
|
+
</tr>
|
242
|
+
</table>
|
243
|
+
</div>
|
244
|
+
</div>
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
<!-- if method_list -->
|
249
|
+
<div id="methods">
|
250
|
+
<h3 class="section-bar">Public Class methods</h3>
|
251
|
+
|
252
|
+
<div id="method-M000063" class="method-detail">
|
253
|
+
<a name="M000063"></a>
|
254
|
+
|
255
|
+
<div class="method-heading">
|
256
|
+
<a href="LongDecimal.src/M000063.html" target="Code" class="method-signature"
|
257
|
+
onclick="popupCode('LongDecimal.src/M000063.html');return false;">
|
258
|
+
<span class="method-name">minus_one!</span><span class="method-args">(s = 0)</span>
|
259
|
+
</a>
|
260
|
+
</div>
|
261
|
+
|
262
|
+
<div class="method-description">
|
263
|
+
<p>
|
264
|
+
creates a <a href="LongDecimal.html">LongDecimal</a> representing minus one
|
265
|
+
with the given number of digits after the decimal point (scale=s)
|
266
|
+
</p>
|
267
|
+
</div>
|
268
|
+
</div>
|
269
|
+
|
270
|
+
<div id="method-M000065" class="method-detail">
|
271
|
+
<a name="M000065"></a>
|
272
|
+
|
273
|
+
<div class="method-heading">
|
274
|
+
<a href="LongDecimal.src/M000065.html" target="Code" class="method-signature"
|
275
|
+
onclick="popupCode('LongDecimal.src/M000065.html');return false;">
|
276
|
+
<span class="method-name">new</span><span class="method-args">(x, s)</span>
|
277
|
+
</a>
|
278
|
+
</div>
|
279
|
+
|
280
|
+
<div class="method-description">
|
281
|
+
<p>
|
282
|
+
initialization parameters: <a
|
283
|
+
href="LongDecimal.html#M000065">LongDecimal.new</a>(x, s) where x is a
|
284
|
+
string or a number and s is the scale the resulting <a
|
285
|
+
href="LongDecimal.html">LongDecimal</a> holds the number x / 10**s
|
286
|
+
</p>
|
287
|
+
</div>
|
288
|
+
</div>
|
289
|
+
|
290
|
+
<div id="method-M000058" class="method-detail">
|
291
|
+
<a name="M000058"></a>
|
292
|
+
|
293
|
+
<div class="method-heading">
|
294
|
+
<a href="LongDecimal.src/M000058.html" target="Code" class="method-signature"
|
295
|
+
onclick="popupCode('LongDecimal.src/M000058.html');return false;">
|
296
|
+
<span class="method-name">new!</span><span class="method-args">(x, s = 0)</span>
|
297
|
+
</a>
|
298
|
+
</div>
|
299
|
+
|
300
|
+
<div class="method-description">
|
301
|
+
<p>
|
302
|
+
initialization parameters:
|
303
|
+
</p>
|
304
|
+
<ol>
|
305
|
+
<li><a href="LongDecimal.html#M000065">LongDecimal.new</a>!(x) where x is a
|
306
|
+
string or a number the resulting <a href="LongDecimal.html">LongDecimal</a>
|
307
|
+
holds the number x, possibly rounded
|
308
|
+
|
309
|
+
</li>
|
310
|
+
<li><a href="LongDecimal.html#M000065">LongDecimal.new</a>!(x, s) where x is a
|
311
|
+
string or a number and s is the scale the resulting <a
|
312
|
+
href="LongDecimal.html">LongDecimal</a> holds the number x / 10**s
|
313
|
+
|
314
|
+
</li>
|
315
|
+
</ol>
|
316
|
+
</div>
|
317
|
+
</div>
|
318
|
+
|
319
|
+
<div id="method-M000060" class="method-detail">
|
320
|
+
<a name="M000060"></a>
|
321
|
+
|
322
|
+
<div class="method-heading">
|
323
|
+
<a href="LongDecimal.src/M000060.html" target="Code" class="method-signature"
|
324
|
+
onclick="popupCode('LongDecimal.src/M000060.html');return false;">
|
325
|
+
<span class="method-name">one!</span><span class="method-args">(s = 0)</span>
|
326
|
+
</a>
|
327
|
+
</div>
|
328
|
+
|
329
|
+
<div class="method-description">
|
330
|
+
<p>
|
331
|
+
creates a <a href="LongDecimal.html">LongDecimal</a> representing one with
|
332
|
+
the given number of digits after the decimal point (scale=s)
|
333
|
+
</p>
|
334
|
+
</div>
|
335
|
+
</div>
|
336
|
+
|
337
|
+
<div id="method-M000064" class="method-detail">
|
338
|
+
<a name="M000064"></a>
|
339
|
+
|
340
|
+
<div class="method-heading">
|
341
|
+
<a href="LongDecimal.src/M000064.html" target="Code" class="method-signature"
|
342
|
+
onclick="popupCode('LongDecimal.src/M000064.html');return false;">
|
343
|
+
<span class="method-name">power_of_ten!</span><span class="method-args">(e, s = 0)</span>
|
344
|
+
</a>
|
345
|
+
</div>
|
346
|
+
|
347
|
+
<div class="method-description">
|
348
|
+
<p>
|
349
|
+
creates a <a href="LongDecimal.html">LongDecimal</a> representing a power
|
350
|
+
of ten with the given exponent e and with the given number of digits after
|
351
|
+
the decimal point (scale=s)
|
352
|
+
</p>
|
353
|
+
</div>
|
354
|
+
</div>
|
355
|
+
|
356
|
+
<div id="method-M000062" class="method-detail">
|
357
|
+
<a name="M000062"></a>
|
358
|
+
|
359
|
+
<div class="method-heading">
|
360
|
+
<a href="LongDecimal.src/M000062.html" target="Code" class="method-signature"
|
361
|
+
onclick="popupCode('LongDecimal.src/M000062.html');return false;">
|
362
|
+
<span class="method-name">ten!</span><span class="method-args">(s = 0)</span>
|
363
|
+
</a>
|
364
|
+
</div>
|
365
|
+
|
366
|
+
<div class="method-description">
|
367
|
+
<p>
|
368
|
+
creates a <a href="LongDecimal.html">LongDecimal</a> representing ten with
|
369
|
+
the given number of digits after the decimal point (scale=s)
|
370
|
+
</p>
|
371
|
+
</div>
|
372
|
+
</div>
|
373
|
+
|
374
|
+
<div id="method-M000061" class="method-detail">
|
375
|
+
<a name="M000061"></a>
|
376
|
+
|
377
|
+
<div class="method-heading">
|
378
|
+
<a href="LongDecimal.src/M000061.html" target="Code" class="method-signature"
|
379
|
+
onclick="popupCode('LongDecimal.src/M000061.html');return false;">
|
380
|
+
<span class="method-name">two!</span><span class="method-args">(s = 0)</span>
|
381
|
+
</a>
|
382
|
+
</div>
|
383
|
+
|
384
|
+
<div class="method-description">
|
385
|
+
<p>
|
386
|
+
creates a <a href="LongDecimal.html">LongDecimal</a> representing two with
|
387
|
+
the given number of digits after the decimal point (scale=s)
|
388
|
+
</p>
|
389
|
+
</div>
|
390
|
+
</div>
|
391
|
+
|
392
|
+
<div id="method-M000059" class="method-detail">
|
393
|
+
<a name="M000059"></a>
|
394
|
+
|
395
|
+
<div class="method-heading">
|
396
|
+
<a href="LongDecimal.src/M000059.html" target="Code" class="method-signature"
|
397
|
+
onclick="popupCode('LongDecimal.src/M000059.html');return false;">
|
398
|
+
<span class="method-name">zero!</span><span class="method-args">(s = 0)</span>
|
399
|
+
</a>
|
400
|
+
</div>
|
401
|
+
|
402
|
+
<div class="method-description">
|
403
|
+
<p>
|
404
|
+
creates a <a href="LongDecimal.html">LongDecimal</a> representing zero with
|
405
|
+
the given number of digits after the decimal point (scale=s)
|
406
|
+
</p>
|
407
|
+
</div>
|
408
|
+
</div>
|
409
|
+
|
410
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
411
|
+
|
412
|
+
<div id="method-M000100" class="method-detail">
|
413
|
+
<a name="M000100"></a>
|
414
|
+
|
415
|
+
<div class="method-heading">
|
416
|
+
<a href="LongDecimal.src/M000100.html" target="Code" class="method-signature"
|
417
|
+
onclick="popupCode('LongDecimal.src/M000100.html');return false;">
|
418
|
+
<span class="method-name">%</span><span class="method-args">(other)</span>
|
419
|
+
</a>
|
420
|
+
</div>
|
421
|
+
|
422
|
+
<div class="method-description">
|
423
|
+
<p>
|
424
|
+
remainder of integer division by other
|
425
|
+
</p>
|
426
|
+
</div>
|
427
|
+
</div>
|
428
|
+
|
429
|
+
<div id="method-M000101" class="method-detail">
|
430
|
+
<a name="M000101"></a>
|
431
|
+
|
432
|
+
<div class="method-heading">
|
433
|
+
<a href="LongDecimal.src/M000101.html" target="Code" class="method-signature"
|
434
|
+
onclick="popupCode('LongDecimal.src/M000101.html');return false;">
|
435
|
+
<span class="method-name">&</span><span class="method-args">(other)</span>
|
436
|
+
</a>
|
437
|
+
</div>
|
438
|
+
|
439
|
+
<div class="method-description">
|
440
|
+
<p>
|
441
|
+
performs bitwise AND between self and other
|
442
|
+
</p>
|
443
|
+
</div>
|
444
|
+
</div>
|
445
|
+
|
446
|
+
<div id="method-M000093" class="method-detail">
|
447
|
+
<a name="M000093"></a>
|
448
|
+
|
449
|
+
<div class="method-heading">
|
450
|
+
<a href="LongDecimal.src/M000093.html" target="Code" class="method-signature"
|
451
|
+
onclick="popupCode('LongDecimal.src/M000093.html');return false;">
|
452
|
+
<span class="method-name">*</span><span class="method-args">(other)</span>
|
453
|
+
</a>
|
454
|
+
</div>
|
455
|
+
|
456
|
+
<div class="method-description">
|
457
|
+
<p>
|
458
|
+
multiply two numbers if both can immediately be expressed as <a
|
459
|
+
href="LongDecimal.html">LongDecimal</a>, the result is a <a
|
460
|
+
href="LongDecimal.html">LongDecimal</a> as well. The number of digits after
|
461
|
+
the decimal point is the sum of the scales of both factors. if <a
|
462
|
+
href="LongDecimal.html">LongDecimal</a> does not cover self and other, the
|
463
|
+
multiplication of Complex, Float or LongRationalQuot is used
|
464
|
+
</p>
|
465
|
+
</div>
|
466
|
+
</div>
|
467
|
+
|
468
|
+
<div id="method-M000098" class="method-detail">
|
469
|
+
<a name="M000098"></a>
|
470
|
+
|
471
|
+
<div class="method-heading">
|
472
|
+
<a href="LongDecimal.src/M000098.html" target="Code" class="method-signature"
|
473
|
+
onclick="popupCode('LongDecimal.src/M000098.html');return false;">
|
474
|
+
<span class="method-name">**</span><span class="method-args">(other)</span>
|
475
|
+
</a>
|
476
|
+
</div>
|
477
|
+
|
478
|
+
<div class="method-description">
|
479
|
+
<p>
|
480
|
+
power of self (<a href="LongDecimal.html">LongDecimal</a>) with other. if
|
481
|
+
other is expressable as non-negative integer, the power is what would be
|
482
|
+
obtained by successive multiplications. if other is expressable as negative
|
483
|
+
integer, the power is a <a href="LongDecimalQuot.html">LongDecimalQuot</a>
|
484
|
+
as would result by successive division, but with the same scale as the
|
485
|
+
positive power would get. Explicit rounding is needed to convert into a <a
|
486
|
+
href="LongDecimal.html">LongDecimal</a> again in all other cases, self is
|
487
|
+
converted into a Rational prior to applying power, usually resulting in a
|
488
|
+
Float as power.
|
489
|
+
</p>
|
490
|
+
</div>
|
491
|
+
</div>
|
492
|
+
|
493
|
+
<div id="method-M000091" class="method-detail">
|
494
|
+
<a name="M000091"></a>
|
495
|
+
|
496
|
+
<div class="method-heading">
|
497
|
+
<a href="LongDecimal.src/M000091.html" target="Code" class="method-signature"
|
498
|
+
onclick="popupCode('LongDecimal.src/M000091.html');return false;">
|
499
|
+
<span class="method-name">+</span><span class="method-args">(other)</span>
|
500
|
+
</a>
|
501
|
+
</div>
|
502
|
+
|
503
|
+
<div class="method-description">
|
504
|
+
<p>
|
505
|
+
add two numbers if both can immediately be expressed as <a
|
506
|
+
href="LongDecimal.html">LongDecimal</a>, the result is a <a
|
507
|
+
href="LongDecimal.html">LongDecimal</a> as well. The number of digits after
|
508
|
+
the decimal point is the max of the scales of the summands if <a
|
509
|
+
href="LongDecimal.html">LongDecimal</a> does not cover the two summands,
|
510
|
+
call addition of Complex, Float or LongRationalQuot
|
511
|
+
</p>
|
512
|
+
</div>
|
513
|
+
</div>
|
514
|
+
|
515
|
+
<div id="method-M000089" class="method-detail">
|
516
|
+
<a name="M000089"></a>
|
517
|
+
|
518
|
+
<div class="method-heading">
|
519
|
+
<a href="LongDecimal.src/M000089.html" target="Code" class="method-signature"
|
520
|
+
onclick="popupCode('LongDecimal.src/M000089.html');return false;">
|
521
|
+
<span class="method-name">+@</span><span class="method-args">()</span>
|
522
|
+
</a>
|
523
|
+
</div>
|
524
|
+
|
525
|
+
<div class="method-description">
|
526
|
+
<p>
|
527
|
+
apply unary + (returns self)
|
528
|
+
</p>
|
529
|
+
</div>
|
530
|
+
</div>
|
531
|
+
|
532
|
+
<div id="method-M000092" class="method-detail">
|
533
|
+
<a name="M000092"></a>
|
534
|
+
|
535
|
+
<div class="method-heading">
|
536
|
+
<a href="LongDecimal.src/M000092.html" target="Code" class="method-signature"
|
537
|
+
onclick="popupCode('LongDecimal.src/M000092.html');return false;">
|
538
|
+
<span class="method-name">-</span><span class="method-args">(other)</span>
|
539
|
+
</a>
|
540
|
+
</div>
|
541
|
+
|
542
|
+
<div class="method-description">
|
543
|
+
<p>
|
544
|
+
subtract two numbers if both can immediately be expressed as <a
|
545
|
+
href="LongDecimal.html">LongDecimal</a>, the result is a <a
|
546
|
+
href="LongDecimal.html">LongDecimal</a> as well. The number of digits after
|
547
|
+
the decimal point is the max of the scales of self and other. if <a
|
548
|
+
href="LongDecimal.html">LongDecimal</a> does not cover self and other, the
|
549
|
+
subtraction of Complex, Float or LongRationalQuot is used
|
550
|
+
</p>
|
551
|
+
</div>
|
552
|
+
</div>
|
553
|
+
|
554
|
+
<div id="method-M000090" class="method-detail">
|
555
|
+
<a name="M000090"></a>
|
556
|
+
|
557
|
+
<div class="method-heading">
|
558
|
+
<a href="LongDecimal.src/M000090.html" target="Code" class="method-signature"
|
559
|
+
onclick="popupCode('LongDecimal.src/M000090.html');return false;">
|
560
|
+
<span class="method-name">-@</span><span class="method-args">()</span>
|
561
|
+
</a>
|
562
|
+
</div>
|
563
|
+
|
564
|
+
<div class="method-description">
|
565
|
+
<p>
|
566
|
+
apply unary - (returns negated self)
|
567
|
+
</p>
|
568
|
+
</div>
|
569
|
+
</div>
|
570
|
+
|
571
|
+
<div id="method-M000097" class="method-detail">
|
572
|
+
<a name="M000097"></a>
|
573
|
+
|
574
|
+
<div class="method-heading">
|
575
|
+
<a href="LongDecimal.src/M000097.html" target="Code" class="method-signature"
|
576
|
+
onclick="popupCode('LongDecimal.src/M000097.html');return false;">
|
577
|
+
<span class="method-name">/</span><span class="method-args">(other)</span>
|
578
|
+
</a>
|
579
|
+
</div>
|
580
|
+
|
581
|
+
<div class="method-description">
|
582
|
+
<p>
|
583
|
+
divide self by other and return result as <a
|
584
|
+
href="LongDecimalQuot.html">LongDecimalQuot</a> because division does not
|
585
|
+
have an obvious rounding rule like addition, subtraction and
|
586
|
+
multiplication, the result needs to be rounded afterwards to become a <a
|
587
|
+
href="LongDecimal.html">LongDecimal</a> again. This way calculations can
|
588
|
+
still be done in the natural readable way using +, -, *, and /, but the
|
589
|
+
rounding can be provided later. It is very important in complicated
|
590
|
+
calculations put the rounding steps in the right places, usually after
|
591
|
+
having performed a division.
|
592
|
+
</p>
|
593
|
+
</div>
|
594
|
+
</div>
|
595
|
+
|
596
|
+
<div id="method-M000105" class="method-detail">
|
597
|
+
<a name="M000105"></a>
|
598
|
+
|
599
|
+
<div class="method-heading">
|
600
|
+
<a href="LongDecimal.src/M000105.html" target="Code" class="method-signature"
|
601
|
+
onclick="popupCode('LongDecimal.src/M000105.html');return false;">
|
602
|
+
<span class="method-name"><<</span><span class="method-args">(other)</span>
|
603
|
+
</a>
|
604
|
+
</div>
|
605
|
+
|
606
|
+
<div class="method-description">
|
607
|
+
<p>
|
608
|
+
performs bitwise left shift of self by other
|
609
|
+
</p>
|
610
|
+
</div>
|
611
|
+
</div>
|
612
|
+
|
613
|
+
<div id="method-M000119" class="method-detail">
|
614
|
+
<a name="M000119"></a>
|
615
|
+
|
616
|
+
<div class="method-heading">
|
617
|
+
<a href="LongDecimal.src/M000119.html" target="Code" class="method-signature"
|
618
|
+
onclick="popupCode('LongDecimal.src/M000119.html');return false;">
|
619
|
+
<span class="method-name"><=></span><span class="method-args">(other)</span>
|
620
|
+
</a>
|
621
|
+
</div>
|
622
|
+
|
623
|
+
<div class="method-description">
|
624
|
+
<p>
|
625
|
+
Compares the two numbers. returns -1 if self < other
|
626
|
+
</p>
|
627
|
+
<pre>
|
628
|
+
0 if self-other = 0
|
629
|
+
+1 if self > other
|
630
|
+
</pre>
|
631
|
+
<p>
|
632
|
+
it needs to be observed, that x == y implies (x <=> y) == 0 but not
|
633
|
+
(x <=> y) == 0 implies x == y because == also takes the scale into
|
634
|
+
account and considers two numbers only equal, if they have the same number
|
635
|
+
of potentially zero digits after the decimal point.
|
636
|
+
</p>
|
637
|
+
</div>
|
638
|
+
</div>
|
639
|
+
|
640
|
+
<div id="method-M000127" class="method-detail">
|
641
|
+
<a name="M000127"></a>
|
642
|
+
|
643
|
+
<div class="method-heading">
|
644
|
+
<a href="LongDecimal.src/M000127.html" target="Code" class="method-signature"
|
645
|
+
onclick="popupCode('LongDecimal.src/M000127.html');return false;">
|
646
|
+
<span class="method-name">==</span><span class="method-args">(other)</span>
|
647
|
+
</a>
|
648
|
+
</div>
|
649
|
+
|
650
|
+
<div class="method-description">
|
651
|
+
<p>
|
652
|
+
comparison of self with other for equality takes into account the values
|
653
|
+
expressed by self and other and the equality of the number of digits.
|
654
|
+
</p>
|
655
|
+
</div>
|
656
|
+
</div>
|
657
|
+
|
658
|
+
<div id="method-M000106" class="method-detail">
|
659
|
+
<a name="M000106"></a>
|
660
|
+
|
661
|
+
<div class="method-heading">
|
662
|
+
<a href="LongDecimal.src/M000106.html" target="Code" class="method-signature"
|
663
|
+
onclick="popupCode('LongDecimal.src/M000106.html');return false;">
|
664
|
+
<span class="method-name">>></span><span class="method-args">(other)</span>
|
665
|
+
</a>
|
666
|
+
</div>
|
667
|
+
|
668
|
+
<div class="method-description">
|
669
|
+
<p>
|
670
|
+
performs bitwise right shift of self by other
|
671
|
+
</p>
|
672
|
+
</div>
|
673
|
+
</div>
|
674
|
+
|
675
|
+
<div id="method-M000107" class="method-detail">
|
676
|
+
<a name="M000107"></a>
|
677
|
+
|
678
|
+
<div class="method-heading">
|
679
|
+
<a href="LongDecimal.src/M000107.html" target="Code" class="method-signature"
|
680
|
+
onclick="popupCode('LongDecimal.src/M000107.html');return false;">
|
681
|
+
<span class="method-name">[]</span><span class="method-args">(other)</span>
|
682
|
+
</a>
|
683
|
+
</div>
|
684
|
+
|
685
|
+
<div class="method-description">
|
686
|
+
<p>
|
687
|
+
gets binary digit of self
|
688
|
+
</p>
|
689
|
+
</div>
|
690
|
+
</div>
|
691
|
+
|
692
|
+
<div id="method-M000103" class="method-detail">
|
693
|
+
<a name="M000103"></a>
|
694
|
+
|
695
|
+
<div class="method-heading">
|
696
|
+
<a href="LongDecimal.src/M000103.html" target="Code" class="method-signature"
|
697
|
+
onclick="popupCode('LongDecimal.src/M000103.html');return false;">
|
698
|
+
<span class="method-name">^</span><span class="method-args">(other)</span>
|
699
|
+
</a>
|
700
|
+
</div>
|
701
|
+
|
702
|
+
<div class="method-description">
|
703
|
+
<p>
|
704
|
+
performs bitwise XOR between self and other
|
705
|
+
</p>
|
706
|
+
</div>
|
707
|
+
</div>
|
708
|
+
|
709
|
+
<div id="method-M000117" class="method-detail">
|
710
|
+
<a name="M000117"></a>
|
711
|
+
|
712
|
+
<div class="method-heading">
|
713
|
+
<a href="LongDecimal.src/M000117.html" target="Code" class="method-signature"
|
714
|
+
onclick="popupCode('LongDecimal.src/M000117.html');return false;">
|
715
|
+
<span class="method-name">abs</span><span class="method-args">()</span>
|
716
|
+
</a>
|
717
|
+
</div>
|
718
|
+
|
719
|
+
<div class="method-description">
|
720
|
+
<p>
|
721
|
+
Absolute value
|
722
|
+
</p>
|
723
|
+
</div>
|
724
|
+
</div>
|
725
|
+
|
726
|
+
<div id="method-M000118" class="method-detail">
|
727
|
+
<a name="M000118"></a>
|
728
|
+
|
729
|
+
<div class="method-heading">
|
730
|
+
<span class="method-name">abs2</span><span class="method-args">()</span>
|
731
|
+
</div>
|
732
|
+
|
733
|
+
<div class="method-description">
|
734
|
+
<p>
|
735
|
+
Alias for <a href="LongDecimal.html#M000113">square</a>
|
736
|
+
</p>
|
737
|
+
</div>
|
738
|
+
</div>
|
739
|
+
|
740
|
+
<div id="method-M000080" class="method-detail">
|
741
|
+
<a name="M000080"></a>
|
742
|
+
|
743
|
+
<div class="method-heading">
|
744
|
+
<a href="LongDecimal.src/M000080.html" target="Code" class="method-signature"
|
745
|
+
onclick="popupCode('LongDecimal.src/M000080.html');return false;">
|
746
|
+
<span class="method-name">anti_equalize_scale</span><span class="method-args">(other)</span>
|
747
|
+
</a>
|
748
|
+
</div>
|
749
|
+
|
750
|
+
<div class="method-description">
|
751
|
+
<p>
|
752
|
+
before dividing two <a href="LongDecimal.html">LongDecimal</a> numbers, it
|
753
|
+
is mandatory to set make them both to integers, so the result is simply
|
754
|
+
expressable as a rational this method is mostly for internal use
|
755
|
+
</p>
|
756
|
+
</div>
|
757
|
+
</div>
|
758
|
+
|
759
|
+
<div id="method-M000122" class="method-detail">
|
760
|
+
<a name="M000122"></a>
|
761
|
+
|
762
|
+
<div class="method-heading">
|
763
|
+
<a href="LongDecimal.src/M000122.html" target="Code" class="method-signature"
|
764
|
+
onclick="popupCode('LongDecimal.src/M000122.html');return false;">
|
765
|
+
<span class="method-name">coerce</span><span class="method-args">(other)</span>
|
766
|
+
</a>
|
767
|
+
</div>
|
768
|
+
|
769
|
+
<div class="method-description">
|
770
|
+
<p>
|
771
|
+
return a pair o, s resembling other, self, but potentially converted to
|
772
|
+
compatible types and ready for arithmetic operations.
|
773
|
+
</p>
|
774
|
+
</div>
|
775
|
+
</div>
|
776
|
+
|
777
|
+
<div id="method-M000085" class="method-detail">
|
778
|
+
<a name="M000085"></a>
|
779
|
+
|
780
|
+
<div class="method-heading">
|
781
|
+
<a href="LongDecimal.src/M000085.html" target="Code" class="method-signature"
|
782
|
+
onclick="popupCode('LongDecimal.src/M000085.html');return false;">
|
783
|
+
<span class="method-name">dec</span><span class="method-args">()</span>
|
784
|
+
</a>
|
785
|
+
</div>
|
786
|
+
|
787
|
+
<div class="method-description">
|
788
|
+
<p>
|
789
|
+
self - 1
|
790
|
+
</p>
|
791
|
+
</div>
|
792
|
+
</div>
|
793
|
+
|
794
|
+
<div id="method-M000087" class="method-detail">
|
795
|
+
<a name="M000087"></a>
|
796
|
+
|
797
|
+
<div class="method-heading">
|
798
|
+
<a href="LongDecimal.src/M000087.html" target="Code" class="method-signature"
|
799
|
+
onclick="popupCode('LongDecimal.src/M000087.html');return false;">
|
800
|
+
<span class="method-name">dec!</span><span class="method-args">()</span>
|
801
|
+
</a>
|
802
|
+
</div>
|
803
|
+
|
804
|
+
<div class="method-description">
|
805
|
+
<p>
|
806
|
+
self -= 1
|
807
|
+
</p>
|
808
|
+
</div>
|
809
|
+
</div>
|
810
|
+
|
811
|
+
<div id="method-M000076" class="method-detail">
|
812
|
+
<a name="M000076"></a>
|
813
|
+
|
814
|
+
<div class="method-heading">
|
815
|
+
<a href="LongDecimal.src/M000076.html" target="Code" class="method-signature"
|
816
|
+
onclick="popupCode('LongDecimal.src/M000076.html');return false;">
|
817
|
+
<span class="method-name">denominator</span><span class="method-args">()</span>
|
818
|
+
</a>
|
819
|
+
</div>
|
820
|
+
|
821
|
+
<div class="method-description">
|
822
|
+
<p>
|
823
|
+
LongDecimals can be seen as a fraction with a power of 10 as denominator
|
824
|
+
for compatibility with other numeric classes this method is included,
|
825
|
+
returning 10**scale. Please observe that there may be common factors of
|
826
|
+
numerator and denominator in case of <a
|
827
|
+
href="LongDecimal.html">LongDecimal</a>, which does not occur in case of
|
828
|
+
Rational
|
829
|
+
</p>
|
830
|
+
</div>
|
831
|
+
</div>
|
832
|
+
|
833
|
+
<div id="method-M000094" class="method-detail">
|
834
|
+
<a name="M000094"></a>
|
835
|
+
|
836
|
+
<div class="method-heading">
|
837
|
+
<a href="LongDecimal.src/M000094.html" target="Code" class="method-signature"
|
838
|
+
onclick="popupCode('LongDecimal.src/M000094.html');return false;">
|
839
|
+
<span class="method-name">divide</span><span class="method-args">(other, rounding_mode)</span>
|
840
|
+
</a>
|
841
|
+
</div>
|
842
|
+
|
843
|
+
<div class="method-description">
|
844
|
+
<p>
|
845
|
+
divide self by other and round result to scale of self using the given
|
846
|
+
rounding mode
|
847
|
+
</p>
|
848
|
+
</div>
|
849
|
+
</div>
|
850
|
+
|
851
|
+
<div id="method-M000095" class="method-detail">
|
852
|
+
<a name="M000095"></a>
|
853
|
+
|
854
|
+
<div class="method-heading">
|
855
|
+
<a href="LongDecimal.src/M000095.html" target="Code" class="method-signature"
|
856
|
+
onclick="popupCode('LongDecimal.src/M000095.html');return false;">
|
857
|
+
<span class="method-name">divide_s</span><span class="method-args">(other, new_scale, rounding_mode)</span>
|
858
|
+
</a>
|
859
|
+
</div>
|
860
|
+
|
861
|
+
<div class="method-description">
|
862
|
+
<p>
|
863
|
+
divide self by other and round result to new_scale using the given rounding
|
864
|
+
mode. If new_scale is nil, use scale of self.
|
865
|
+
</p>
|
866
|
+
</div>
|
867
|
+
</div>
|
868
|
+
|
869
|
+
<div id="method-M000099" class="method-detail">
|
870
|
+
<a name="M000099"></a>
|
871
|
+
|
872
|
+
<div class="method-heading">
|
873
|
+
<a href="LongDecimal.src/M000099.html" target="Code" class="method-signature"
|
874
|
+
onclick="popupCode('LongDecimal.src/M000099.html');return false;">
|
875
|
+
<span class="method-name">divmod</span><span class="method-args">(other)</span>
|
876
|
+
</a>
|
877
|
+
</div>
|
878
|
+
|
879
|
+
<div class="method-description">
|
880
|
+
<p>
|
881
|
+
do integer division with remainder, returning two values
|
882
|
+
</p>
|
883
|
+
</div>
|
884
|
+
</div>
|
885
|
+
|
886
|
+
<div id="method-M000079" class="method-detail">
|
887
|
+
<a name="M000079"></a>
|
888
|
+
|
889
|
+
<div class="method-heading">
|
890
|
+
<a href="LongDecimal.src/M000079.html" target="Code" class="method-signature"
|
891
|
+
onclick="popupCode('LongDecimal.src/M000079.html');return false;">
|
892
|
+
<span class="method-name">equalize_scale</span><span class="method-args">(other)</span>
|
893
|
+
</a>
|
894
|
+
</div>
|
895
|
+
|
896
|
+
<div class="method-description">
|
897
|
+
<p>
|
898
|
+
before adding or subtracting two <a href="LongDecimal.html">LongDecimal</a>
|
899
|
+
numbers it is mandatory to set them to the same scale. The maximum of the
|
900
|
+
two summands is used, in order to avoid loosing any information. this
|
901
|
+
method is mostly for internal use
|
902
|
+
</p>
|
903
|
+
</div>
|
904
|
+
</div>
|
905
|
+
|
906
|
+
<div id="method-M000130" class="method-detail">
|
907
|
+
<a name="M000130"></a>
|
908
|
+
|
909
|
+
<div class="method-heading">
|
910
|
+
<a href="LongDecimal.src/M000130.html" target="Code" class="method-signature"
|
911
|
+
onclick="popupCode('LongDecimal.src/M000130.html');return false;">
|
912
|
+
<span class="method-name">hash</span><span class="method-args">()</span>
|
913
|
+
</a>
|
914
|
+
</div>
|
915
|
+
|
916
|
+
<div class="method-description">
|
917
|
+
<p>
|
918
|
+
Returns a hash code for the complex number.
|
919
|
+
</p>
|
920
|
+
</div>
|
921
|
+
</div>
|
922
|
+
|
923
|
+
<div id="method-M000084" class="method-detail">
|
924
|
+
<a name="M000084"></a>
|
925
|
+
|
926
|
+
<div class="method-heading">
|
927
|
+
<a href="LongDecimal.src/M000084.html" target="Code" class="method-signature"
|
928
|
+
onclick="popupCode('LongDecimal.src/M000084.html');return false;">
|
929
|
+
<span class="method-name">inc</span><span class="method-args">()</span>
|
930
|
+
</a>
|
931
|
+
</div>
|
932
|
+
|
933
|
+
<div class="method-description">
|
934
|
+
<p>
|
935
|
+
self + 1
|
936
|
+
</p>
|
937
|
+
</div>
|
938
|
+
</div>
|
939
|
+
|
940
|
+
<div id="method-M000086" class="method-detail">
|
941
|
+
<a name="M000086"></a>
|
942
|
+
|
943
|
+
<div class="method-heading">
|
944
|
+
<a href="LongDecimal.src/M000086.html" target="Code" class="method-signature"
|
945
|
+
onclick="popupCode('LongDecimal.src/M000086.html');return false;">
|
946
|
+
<span class="method-name">inc!</span><span class="method-args">()</span>
|
947
|
+
</a>
|
948
|
+
</div>
|
949
|
+
|
950
|
+
<div class="method-description">
|
951
|
+
<p>
|
952
|
+
self += 1
|
953
|
+
</p>
|
954
|
+
</div>
|
955
|
+
</div>
|
956
|
+
|
957
|
+
<div id="method-M000131" class="method-detail">
|
958
|
+
<a name="M000131"></a>
|
959
|
+
|
960
|
+
<div class="method-heading">
|
961
|
+
<a href="LongDecimal.src/M000131.html" target="Code" class="method-signature"
|
962
|
+
onclick="popupCode('LongDecimal.src/M000131.html');return false;">
|
963
|
+
<span class="method-name">inspect</span><span class="method-args">()</span>
|
964
|
+
</a>
|
965
|
+
</div>
|
966
|
+
|
967
|
+
<div class="method-description">
|
968
|
+
<p>
|
969
|
+
Returns "<tt><a
|
970
|
+
href="LongDecimal.html">LongDecimal</a>(<em>int_val</em>,
|
971
|
+
<em>scale</em>)</tt>".
|
972
|
+
</p>
|
973
|
+
</div>
|
974
|
+
</div>
|
975
|
+
|
976
|
+
<div id="method-M000078" class="method-detail">
|
977
|
+
<a name="M000078"></a>
|
978
|
+
|
979
|
+
<div class="method-heading">
|
980
|
+
<a href="LongDecimal.src/M000078.html" target="Code" class="method-signature"
|
981
|
+
onclick="popupCode('LongDecimal.src/M000078.html');return false;">
|
982
|
+
<span class="method-name">int_digits10</span><span class="method-args">()</span>
|
983
|
+
</a>
|
984
|
+
</div>
|
985
|
+
|
986
|
+
<div class="method-description">
|
987
|
+
<p>
|
988
|
+
number of decimal digits before the decimal point, not counting a single 0.
|
989
|
+
0.xxx -> 0 1.xxx -> 1 10.xxx -> 2 …
|
990
|
+
</p>
|
991
|
+
</div>
|
992
|
+
</div>
|
993
|
+
|
994
|
+
<div id="method-M000077" class="method-detail">
|
995
|
+
<a name="M000077"></a>
|
996
|
+
|
997
|
+
<div class="method-heading">
|
998
|
+
<a href="LongDecimal.src/M000077.html" target="Code" class="method-signature"
|
999
|
+
onclick="popupCode('LongDecimal.src/M000077.html');return false;">
|
1000
|
+
<span class="method-name">int_digits2</span><span class="method-args">()</span>
|
1001
|
+
</a>
|
1002
|
+
</div>
|
1003
|
+
|
1004
|
+
<div class="method-description">
|
1005
|
+
<p>
|
1006
|
+
number of binary digits before the decimal point, not counting a single 0.
|
1007
|
+
0.xxx -> 0 1.xxx -> 1 2.xxx -> 2 4.xxx -> 3 8.xxx -> 4
|
1008
|
+
…
|
1009
|
+
</p>
|
1010
|
+
</div>
|
1011
|
+
</div>
|
1012
|
+
|
1013
|
+
<div id="method-M000116" class="method-detail">
|
1014
|
+
<a name="M000116"></a>
|
1015
|
+
|
1016
|
+
<div class="method-heading">
|
1017
|
+
<span class="method-name">inverse</span><span class="method-args">()</span>
|
1018
|
+
</div>
|
1019
|
+
|
1020
|
+
<div class="method-description">
|
1021
|
+
<p>
|
1022
|
+
Alias for <a href="LongDecimal.html#M000115">reciprocal</a>
|
1023
|
+
</p>
|
1024
|
+
</div>
|
1025
|
+
</div>
|
1026
|
+
|
1027
|
+
<div id="method-M000123" class="method-detail">
|
1028
|
+
<a name="M000123"></a>
|
1029
|
+
|
1030
|
+
<div class="method-heading">
|
1031
|
+
<a href="LongDecimal.src/M000123.html" target="Code" class="method-signature"
|
1032
|
+
onclick="popupCode('LongDecimal.src/M000123.html');return false;">
|
1033
|
+
<span class="method-name">is_int?</span><span class="method-args">()</span>
|
1034
|
+
</a>
|
1035
|
+
</div>
|
1036
|
+
|
1037
|
+
<div class="method-description">
|
1038
|
+
<p>
|
1039
|
+
is self expressable as an integer without loss of digits?
|
1040
|
+
</p>
|
1041
|
+
</div>
|
1042
|
+
</div>
|
1043
|
+
|
1044
|
+
<div id="method-M000109" class="method-detail">
|
1045
|
+
<a name="M000109"></a>
|
1046
|
+
|
1047
|
+
<div class="method-heading">
|
1048
|
+
<a href="LongDecimal.src/M000109.html" target="Code" class="method-signature"
|
1049
|
+
onclick="popupCode('LongDecimal.src/M000109.html');return false;">
|
1050
|
+
<span class="method-name">move_point_left</span><span class="method-args">(n)</span>
|
1051
|
+
</a>
|
1052
|
+
</div>
|
1053
|
+
|
1054
|
+
<div class="method-description">
|
1055
|
+
<p>
|
1056
|
+
divide by 10**n
|
1057
|
+
</p>
|
1058
|
+
</div>
|
1059
|
+
</div>
|
1060
|
+
|
1061
|
+
<div id="method-M000110" class="method-detail">
|
1062
|
+
<a name="M000110"></a>
|
1063
|
+
|
1064
|
+
<div class="method-heading">
|
1065
|
+
<a href="LongDecimal.src/M000110.html" target="Code" class="method-signature"
|
1066
|
+
onclick="popupCode('LongDecimal.src/M000110.html');return false;">
|
1067
|
+
<span class="method-name">move_point_right</span><span class="method-args">(n)</span>
|
1068
|
+
</a>
|
1069
|
+
</div>
|
1070
|
+
|
1071
|
+
<div class="method-description">
|
1072
|
+
<p>
|
1073
|
+
multiply by 10**n
|
1074
|
+
</p>
|
1075
|
+
</div>
|
1076
|
+
</div>
|
1077
|
+
|
1078
|
+
<div id="method-M000082" class="method-detail">
|
1079
|
+
<a name="M000082"></a>
|
1080
|
+
|
1081
|
+
<div class="method-heading">
|
1082
|
+
<span class="method-name">next</span><span class="method-args">()</span>
|
1083
|
+
</div>
|
1084
|
+
|
1085
|
+
<div class="method-description">
|
1086
|
+
<p>
|
1087
|
+
Alias for <a href="LongDecimal.html#M000081">succ</a>
|
1088
|
+
</p>
|
1089
|
+
</div>
|
1090
|
+
</div>
|
1091
|
+
|
1092
|
+
<div id="method-M000129" class="method-detail">
|
1093
|
+
<a name="M000129"></a>
|
1094
|
+
|
1095
|
+
<div class="method-heading">
|
1096
|
+
<a href="LongDecimal.src/M000129.html" target="Code" class="method-signature"
|
1097
|
+
onclick="popupCode('LongDecimal.src/M000129.html');return false;">
|
1098
|
+
<span class="method-name">one?</span><span class="method-args">()</span>
|
1099
|
+
</a>
|
1100
|
+
</div>
|
1101
|
+
|
1102
|
+
<div class="method-description">
|
1103
|
+
<p>
|
1104
|
+
check if the number expressed by self is 1 (one) with any number of 0s
|
1105
|
+
after the decimal point.
|
1106
|
+
</p>
|
1107
|
+
</div>
|
1108
|
+
</div>
|
1109
|
+
|
1110
|
+
<div id="method-M000083" class="method-detail">
|
1111
|
+
<a name="M000083"></a>
|
1112
|
+
|
1113
|
+
<div class="method-heading">
|
1114
|
+
<a href="LongDecimal.src/M000083.html" target="Code" class="method-signature"
|
1115
|
+
onclick="popupCode('LongDecimal.src/M000083.html');return false;">
|
1116
|
+
<span class="method-name">pred</span><span class="method-args">()</span>
|
1117
|
+
</a>
|
1118
|
+
</div>
|
1119
|
+
|
1120
|
+
<div class="method-description">
|
1121
|
+
<p>
|
1122
|
+
predecessor (opposite of successor) it needs to be observed that this is
|
1123
|
+
usually not an decrement by 1, but by 1/10**scale.
|
1124
|
+
</p>
|
1125
|
+
</div>
|
1126
|
+
</div>
|
1127
|
+
|
1128
|
+
<div id="method-M000096" class="method-detail">
|
1129
|
+
<a name="M000096"></a>
|
1130
|
+
|
1131
|
+
<div class="method-heading">
|
1132
|
+
<a href="LongDecimal.src/M000096.html" target="Code" class="method-signature"
|
1133
|
+
onclick="popupCode('LongDecimal.src/M000096.html');return false;">
|
1134
|
+
<span class="method-name">rdiv</span><span class="method-args">(other)</span>
|
1135
|
+
</a>
|
1136
|
+
</div>
|
1137
|
+
|
1138
|
+
<div class="method-description">
|
1139
|
+
<p>
|
1140
|
+
divide self by other and return result as Rational, if other allowed exact
|
1141
|
+
calculations.
|
1142
|
+
</p>
|
1143
|
+
</div>
|
1144
|
+
</div>
|
1145
|
+
|
1146
|
+
<div id="method-M000115" class="method-detail">
|
1147
|
+
<a name="M000115"></a>
|
1148
|
+
|
1149
|
+
<div class="method-heading">
|
1150
|
+
<a href="LongDecimal.src/M000115.html" target="Code" class="method-signature"
|
1151
|
+
onclick="popupCode('LongDecimal.src/M000115.html');return false;">
|
1152
|
+
<span class="method-name">reciprocal</span><span class="method-args">()</span>
|
1153
|
+
</a>
|
1154
|
+
</div>
|
1155
|
+
|
1156
|
+
<div class="method-description">
|
1157
|
+
<p>
|
1158
|
+
calculate the multiplicative inverse
|
1159
|
+
</p>
|
1160
|
+
</div>
|
1161
|
+
</div>
|
1162
|
+
|
1163
|
+
<div id="method-M000067" class="method-detail">
|
1164
|
+
<a name="M000067"></a>
|
1165
|
+
|
1166
|
+
<div class="method-heading">
|
1167
|
+
<a href="LongDecimal.src/M000067.html" target="Code" class="method-signature"
|
1168
|
+
onclick="popupCode('LongDecimal.src/M000067.html');return false;">
|
1169
|
+
<span class="method-name">round_to_scale</span><span class="method-args">(new_scale, mode = ROUND_UNNECESSARY)</span>
|
1170
|
+
</a>
|
1171
|
+
</div>
|
1172
|
+
|
1173
|
+
<div class="method-description">
|
1174
|
+
<p>
|
1175
|
+
create copy of self with different scale param1: new_scale new scale for
|
1176
|
+
result param2: mode rounding mode to be applied when information is
|
1177
|
+
</p>
|
1178
|
+
<pre>
|
1179
|
+
lost. defaults to ROUND_UNNECESSARY, which
|
1180
|
+
means that an exception is thrown if rounding
|
1181
|
+
would actually loose any information.
|
1182
|
+
</pre>
|
1183
|
+
</div>
|
1184
|
+
</div>
|
1185
|
+
|
1186
|
+
<div id="method-M000121" class="method-detail">
|
1187
|
+
<a name="M000121"></a>
|
1188
|
+
|
1189
|
+
<div class="method-heading">
|
1190
|
+
<a href="LongDecimal.src/M000121.html" target="Code" class="method-signature"
|
1191
|
+
onclick="popupCode('LongDecimal.src/M000121.html');return false;">
|
1192
|
+
<span class="method-name">scale_equal</span><span class="method-args">(other)</span>
|
1193
|
+
</a>
|
1194
|
+
</div>
|
1195
|
+
|
1196
|
+
<div class="method-description">
|
1197
|
+
<h2>-comparison for the scales</h2>
|
1198
|
+
</div>
|
1199
|
+
</div>
|
1200
|
+
|
1201
|
+
<div id="method-M000120" class="method-detail">
|
1202
|
+
<a name="M000120"></a>
|
1203
|
+
|
1204
|
+
<div class="method-heading">
|
1205
|
+
<a href="LongDecimal.src/M000120.html" target="Code" class="method-signature"
|
1206
|
+
onclick="popupCode('LongDecimal.src/M000120.html');return false;">
|
1207
|
+
<span class="method-name">scale_ufo</span><span class="method-args">(other)</span>
|
1208
|
+
</a>
|
1209
|
+
</div>
|
1210
|
+
|
1211
|
+
<div class="method-description">
|
1212
|
+
<p>
|
1213
|
+
<=>-comparison for the scales
|
1214
|
+
</p>
|
1215
|
+
</div>
|
1216
|
+
</div>
|
1217
|
+
|
1218
|
+
<div id="method-M000124" class="method-detail">
|
1219
|
+
<a name="M000124"></a>
|
1220
|
+
|
1221
|
+
<div class="method-heading">
|
1222
|
+
<a href="LongDecimal.src/M000124.html" target="Code" class="method-signature"
|
1223
|
+
onclick="popupCode('LongDecimal.src/M000124.html');return false;">
|
1224
|
+
<span class="method-name">sgn</span><span class="method-args">()</span>
|
1225
|
+
</a>
|
1226
|
+
</div>
|
1227
|
+
|
1228
|
+
<div class="method-description">
|
1229
|
+
<p>
|
1230
|
+
get the sign of self -1 if self < 0
|
1231
|
+
</p>
|
1232
|
+
<pre>
|
1233
|
+
0 if self is 0 (with any number of 0s after the decimal point)
|
1234
|
+
</pre>
|
1235
|
+
<p>
|
1236
|
+
+1 if self > 0
|
1237
|
+
</p>
|
1238
|
+
</div>
|
1239
|
+
</div>
|
1240
|
+
|
1241
|
+
<div id="method-M000126" class="method-detail">
|
1242
|
+
<a name="M000126"></a>
|
1243
|
+
|
1244
|
+
<div class="method-heading">
|
1245
|
+
<span class="method-name">sign</span><span class="method-args">()</span>
|
1246
|
+
</div>
|
1247
|
+
|
1248
|
+
<div class="method-description">
|
1249
|
+
<p>
|
1250
|
+
Alias for <a href="LongDecimal.html#M000124">sgn</a>
|
1251
|
+
</p>
|
1252
|
+
</div>
|
1253
|
+
</div>
|
1254
|
+
|
1255
|
+
<div id="method-M000125" class="method-detail">
|
1256
|
+
<a name="M000125"></a>
|
1257
|
+
|
1258
|
+
<div class="method-heading">
|
1259
|
+
<span class="method-name">signum</span><span class="method-args">()</span>
|
1260
|
+
</div>
|
1261
|
+
|
1262
|
+
<div class="method-description">
|
1263
|
+
<p>
|
1264
|
+
Alias for <a href="LongDecimal.html#M000124">sgn</a>
|
1265
|
+
</p>
|
1266
|
+
</div>
|
1267
|
+
</div>
|
1268
|
+
|
1269
|
+
<div id="method-M000108" class="method-detail">
|
1270
|
+
<a name="M000108"></a>
|
1271
|
+
|
1272
|
+
<div class="method-heading">
|
1273
|
+
<a href="LongDecimal.src/M000108.html" target="Code" class="method-signature"
|
1274
|
+
onclick="popupCode('LongDecimal.src/M000108.html');return false;">
|
1275
|
+
<span class="method-name">size</span><span class="method-args">()</span>
|
1276
|
+
</a>
|
1277
|
+
</div>
|
1278
|
+
|
1279
|
+
<div class="method-description">
|
1280
|
+
<p>
|
1281
|
+
gets size of int_val
|
1282
|
+
</p>
|
1283
|
+
</div>
|
1284
|
+
</div>
|
1285
|
+
|
1286
|
+
<div id="method-M000114" class="method-detail">
|
1287
|
+
<a name="M000114"></a>
|
1288
|
+
|
1289
|
+
<div class="method-heading">
|
1290
|
+
<a href="LongDecimal.src/M000114.html" target="Code" class="method-signature"
|
1291
|
+
onclick="popupCode('LongDecimal.src/M000114.html');return false;">
|
1292
|
+
<span class="method-name">sqrt</span><span class="method-args">(new_scale, rounding_mode)</span>
|
1293
|
+
</a>
|
1294
|
+
</div>
|
1295
|
+
|
1296
|
+
<div class="method-description">
|
1297
|
+
</div>
|
1298
|
+
</div>
|
1299
|
+
|
1300
|
+
<div id="method-M000113" class="method-detail">
|
1301
|
+
<a name="M000113"></a>
|
1302
|
+
|
1303
|
+
<div class="method-heading">
|
1304
|
+
<a href="LongDecimal.src/M000113.html" target="Code" class="method-signature"
|
1305
|
+
onclick="popupCode('LongDecimal.src/M000113.html');return false;">
|
1306
|
+
<span class="method-name">square</span><span class="method-args">()</span>
|
1307
|
+
</a>
|
1308
|
+
</div>
|
1309
|
+
|
1310
|
+
<div class="method-description">
|
1311
|
+
<p>
|
1312
|
+
calculate the square of self
|
1313
|
+
</p>
|
1314
|
+
</div>
|
1315
|
+
</div>
|
1316
|
+
|
1317
|
+
<div id="method-M000081" class="method-detail">
|
1318
|
+
<a name="M000081"></a>
|
1319
|
+
|
1320
|
+
<div class="method-heading">
|
1321
|
+
<a href="LongDecimal.src/M000081.html" target="Code" class="method-signature"
|
1322
|
+
onclick="popupCode('LongDecimal.src/M000081.html');return false;">
|
1323
|
+
<span class="method-name">succ</span><span class="method-args">()</span>
|
1324
|
+
</a>
|
1325
|
+
</div>
|
1326
|
+
|
1327
|
+
<div class="method-description">
|
1328
|
+
<p>
|
1329
|
+
successor as needed for using <a href="LongDecimal.html">LongDecimal</a> in
|
1330
|
+
ranges it needs to be observed that this is usually not an increment by 1,
|
1331
|
+
but by 1/10**scale.
|
1332
|
+
</p>
|
1333
|
+
</div>
|
1334
|
+
</div>
|
1335
|
+
|
1336
|
+
<div id="method-M000075" class="method-detail">
|
1337
|
+
<a name="M000075"></a>
|
1338
|
+
|
1339
|
+
<div class="method-heading">
|
1340
|
+
<a href="LongDecimal.src/M000075.html" target="Code" class="method-signature"
|
1341
|
+
onclick="popupCode('LongDecimal.src/M000075.html');return false;">
|
1342
|
+
<span class="method-name">to_bd</span><span class="method-args">()</span>
|
1343
|
+
</a>
|
1344
|
+
</div>
|
1345
|
+
|
1346
|
+
<div class="method-description">
|
1347
|
+
<p>
|
1348
|
+
convert selt into BigDecimal
|
1349
|
+
</p>
|
1350
|
+
</div>
|
1351
|
+
</div>
|
1352
|
+
|
1353
|
+
<div id="method-M000072" class="method-detail">
|
1354
|
+
<a name="M000072"></a>
|
1355
|
+
|
1356
|
+
<div class="method-heading">
|
1357
|
+
<a href="LongDecimal.src/M000072.html" target="Code" class="method-signature"
|
1358
|
+
onclick="popupCode('LongDecimal.src/M000072.html');return false;">
|
1359
|
+
<span class="method-name">to_f</span><span class="method-args">()</span>
|
1360
|
+
</a>
|
1361
|
+
</div>
|
1362
|
+
|
1363
|
+
<div class="method-description">
|
1364
|
+
<p>
|
1365
|
+
convert self into Float this works straitforward by dividing int_val by
|
1366
|
+
power of 10 in float-arithmetic, in all cases where numerator and
|
1367
|
+
denominator are within the ranges expressable as Floats. Goes via string
|
1368
|
+
representation otherwise.
|
1369
|
+
</p>
|
1370
|
+
</div>
|
1371
|
+
</div>
|
1372
|
+
|
1373
|
+
<div id="method-M000073" class="method-detail">
|
1374
|
+
<a name="M000073"></a>
|
1375
|
+
|
1376
|
+
<div class="method-heading">
|
1377
|
+
<a href="LongDecimal.src/M000073.html" target="Code" class="method-signature"
|
1378
|
+
onclick="popupCode('LongDecimal.src/M000073.html');return false;">
|
1379
|
+
<span class="method-name">to_i</span><span class="method-args">()</span>
|
1380
|
+
</a>
|
1381
|
+
</div>
|
1382
|
+
|
1383
|
+
<div class="method-description">
|
1384
|
+
<p>
|
1385
|
+
convert self into Integer This may loose information. In most cases it is
|
1386
|
+
preferred to control this by calling <a
|
1387
|
+
href="LongDecimal.html#M000067">round_to_scale</a> first and then applying
|
1388
|
+
<a href="LongDecimal.html#M000073">to_i</a> when the number represented by
|
1389
|
+
self is actually an integer.
|
1390
|
+
</p>
|
1391
|
+
</div>
|
1392
|
+
</div>
|
1393
|
+
|
1394
|
+
<div id="method-M000074" class="method-detail">
|
1395
|
+
<a name="M000074"></a>
|
1396
|
+
|
1397
|
+
<div class="method-heading">
|
1398
|
+
<a href="LongDecimal.src/M000074.html" target="Code" class="method-signature"
|
1399
|
+
onclick="popupCode('LongDecimal.src/M000074.html');return false;">
|
1400
|
+
<span class="method-name">to_ld</span><span class="method-args">()</span>
|
1401
|
+
</a>
|
1402
|
+
</div>
|
1403
|
+
|
1404
|
+
<div class="method-description">
|
1405
|
+
<p>
|
1406
|
+
convert self into <a href="LongDecimal.html">LongDecimal</a> (returns self)
|
1407
|
+
</p>
|
1408
|
+
</div>
|
1409
|
+
</div>
|
1410
|
+
|
1411
|
+
<div id="method-M000071" class="method-detail">
|
1412
|
+
<a name="M000071"></a>
|
1413
|
+
|
1414
|
+
<div class="method-heading">
|
1415
|
+
<a href="LongDecimal.src/M000071.html" target="Code" class="method-signature"
|
1416
|
+
onclick="popupCode('LongDecimal.src/M000071.html');return false;">
|
1417
|
+
<span class="method-name">to_r</span><span class="method-args">()</span>
|
1418
|
+
</a>
|
1419
|
+
</div>
|
1420
|
+
|
1421
|
+
<div class="method-description">
|
1422
|
+
<p>
|
1423
|
+
convert self into Rational this works quite straitforward. use int_val as
|
1424
|
+
numerator and a power of 10 as denominator
|
1425
|
+
</p>
|
1426
|
+
</div>
|
1427
|
+
</div>
|
1428
|
+
|
1429
|
+
<div id="method-M000068" class="method-detail">
|
1430
|
+
<a name="M000068"></a>
|
1431
|
+
|
1432
|
+
<div class="method-heading">
|
1433
|
+
<a href="LongDecimal.src/M000068.html" target="Code" class="method-signature"
|
1434
|
+
onclick="popupCode('LongDecimal.src/M000068.html');return false;">
|
1435
|
+
<span class="method-name">to_s</span><span class="method-args">(shown_scale = @scale, mode = ROUND_UNNECESSARY, base = 10)</span>
|
1436
|
+
</a>
|
1437
|
+
</div>
|
1438
|
+
|
1439
|
+
<div class="method-description">
|
1440
|
+
<p>
|
1441
|
+
optional parameter shown_scale is the number of digits after the decimal
|
1442
|
+
point. Defaults to the scale of self. optional parameter mode ist the
|
1443
|
+
rounding mode to be applied. Defaults to ROUND_UNNECESSARY, in which case
|
1444
|
+
an exception is thrown if rounding is actually necessary. optional
|
1445
|
+
parameter base is the base to be used when expressing self as string.
|
1446
|
+
defaults to 10.
|
1447
|
+
</p>
|
1448
|
+
</div>
|
1449
|
+
</div>
|
1450
|
+
|
1451
|
+
<div id="method-M000088" class="method-detail">
|
1452
|
+
<a name="M000088"></a>
|
1453
|
+
|
1454
|
+
<div class="method-heading">
|
1455
|
+
<a href="LongDecimal.src/M000088.html" target="Code" class="method-signature"
|
1456
|
+
onclick="popupCode('LongDecimal.src/M000088.html');return false;">
|
1457
|
+
<span class="method-name">unit</span><span class="method-args">()</span>
|
1458
|
+
</a>
|
1459
|
+
</div>
|
1460
|
+
|
1461
|
+
<div class="method-description">
|
1462
|
+
<p>
|
1463
|
+
return the unit by which self is incremented by succ
|
1464
|
+
</p>
|
1465
|
+
</div>
|
1466
|
+
</div>
|
1467
|
+
|
1468
|
+
<div id="method-M000128" class="method-detail">
|
1469
|
+
<a name="M000128"></a>
|
1470
|
+
|
1471
|
+
<div class="method-heading">
|
1472
|
+
<a href="LongDecimal.src/M000128.html" target="Code" class="method-signature"
|
1473
|
+
onclick="popupCode('LongDecimal.src/M000128.html');return false;">
|
1474
|
+
<span class="method-name">zero?</span><span class="method-args">()</span>
|
1475
|
+
</a>
|
1476
|
+
</div>
|
1477
|
+
|
1478
|
+
<div class="method-description">
|
1479
|
+
<p>
|
1480
|
+
check if the number expressed by self is 0 (zero) with any number of 0s
|
1481
|
+
after the decimal point.
|
1482
|
+
</p>
|
1483
|
+
</div>
|
1484
|
+
</div>
|
1485
|
+
|
1486
|
+
<div id="method-M000102" class="method-detail">
|
1487
|
+
<a name="M000102"></a>
|
1488
|
+
|
1489
|
+
<div class="method-heading">
|
1490
|
+
<a href="LongDecimal.src/M000102.html" target="Code" class="method-signature"
|
1491
|
+
onclick="popupCode('LongDecimal.src/M000102.html');return false;">
|
1492
|
+
<span class="method-name">|</span><span class="method-args">(other)</span>
|
1493
|
+
</a>
|
1494
|
+
</div>
|
1495
|
+
|
1496
|
+
<div class="method-description">
|
1497
|
+
<p>
|
1498
|
+
performs bitwise OR between self and other
|
1499
|
+
</p>
|
1500
|
+
</div>
|
1501
|
+
</div>
|
1502
|
+
|
1503
|
+
<div id="method-M000104" class="method-detail">
|
1504
|
+
<a name="M000104"></a>
|
1505
|
+
|
1506
|
+
<div class="method-heading">
|
1507
|
+
<a href="LongDecimal.src/M000104.html" target="Code" class="method-signature"
|
1508
|
+
onclick="popupCode('LongDecimal.src/M000104.html');return false;">
|
1509
|
+
<span class="method-name">~</span><span class="method-args">()</span>
|
1510
|
+
</a>
|
1511
|
+
</div>
|
1512
|
+
|
1513
|
+
<div class="method-description">
|
1514
|
+
<p>
|
1515
|
+
bitwise inversion
|
1516
|
+
</p>
|
1517
|
+
</div>
|
1518
|
+
</div>
|
1519
|
+
|
1520
|
+
<h3 class="section-bar">Protected Instance methods</h3>
|
1521
|
+
|
1522
|
+
<div id="method-M000111" class="method-detail">
|
1523
|
+
<a name="M000111"></a>
|
1524
|
+
|
1525
|
+
<div class="method-heading">
|
1526
|
+
<a href="LongDecimal.src/M000111.html" target="Code" class="method-signature"
|
1527
|
+
onclick="popupCode('LongDecimal.src/M000111.html');return false;">
|
1528
|
+
<span class="method-name">move_point_left_int</span><span class="method-args">(n)</span>
|
1529
|
+
</a>
|
1530
|
+
</div>
|
1531
|
+
|
1532
|
+
<div class="method-description">
|
1533
|
+
<p>
|
1534
|
+
internal method divide by 10**n
|
1535
|
+
</p>
|
1536
|
+
</div>
|
1537
|
+
</div>
|
1538
|
+
|
1539
|
+
<div id="method-M000112" class="method-detail">
|
1540
|
+
<a name="M000112"></a>
|
1541
|
+
|
1542
|
+
<div class="method-heading">
|
1543
|
+
<a href="LongDecimal.src/M000112.html" target="Code" class="method-signature"
|
1544
|
+
onclick="popupCode('LongDecimal.src/M000112.html');return false;">
|
1545
|
+
<span class="method-name">move_point_right_int</span><span class="method-args">(n)</span>
|
1546
|
+
</a>
|
1547
|
+
</div>
|
1548
|
+
|
1549
|
+
<div class="method-description">
|
1550
|
+
<p>
|
1551
|
+
internal method multiply by 10**n
|
1552
|
+
</p>
|
1553
|
+
</div>
|
1554
|
+
</div>
|
1555
|
+
|
1556
|
+
<div id="method-M000066" class="method-detail">
|
1557
|
+
<a name="M000066"></a>
|
1558
|
+
|
1559
|
+
<div class="method-heading">
|
1560
|
+
<a href="LongDecimal.src/M000066.html" target="Code" class="method-signature"
|
1561
|
+
onclick="popupCode('LongDecimal.src/M000066.html');return false;">
|
1562
|
+
<span class="method-name">scale=</span><span class="method-args">(s)</span>
|
1563
|
+
</a>
|
1564
|
+
</div>
|
1565
|
+
|
1566
|
+
<div class="method-description">
|
1567
|
+
<p>
|
1568
|
+
alter scale (changes self)
|
1569
|
+
</p>
|
1570
|
+
<p>
|
1571
|
+
only for internal use: use <a
|
1572
|
+
href="LongDecimal.html#M000067">round_to_scale</a> instead
|
1573
|
+
</p>
|
1574
|
+
</div>
|
1575
|
+
</div>
|
1576
|
+
|
1577
|
+
<div id="method-M000069" class="method-detail">
|
1578
|
+
<a name="M000069"></a>
|
1579
|
+
|
1580
|
+
<div class="method-heading">
|
1581
|
+
<a href="LongDecimal.src/M000069.html" target="Code" class="method-signature"
|
1582
|
+
onclick="popupCode('LongDecimal.src/M000069.html');return false;">
|
1583
|
+
<span class="method-name">to_s_10</span><span class="method-args">()</span>
|
1584
|
+
</a>
|
1585
|
+
</div>
|
1586
|
+
|
1587
|
+
<div class="method-description">
|
1588
|
+
<p>
|
1589
|
+
internal helper method, converts self to string in decimal system with
|
1590
|
+
default settings.
|
1591
|
+
</p>
|
1592
|
+
</div>
|
1593
|
+
</div>
|
1594
|
+
|
1595
|
+
<div id="method-M000070" class="method-detail">
|
1596
|
+
<a name="M000070"></a>
|
1597
|
+
|
1598
|
+
<div class="method-heading">
|
1599
|
+
<a href="LongDecimal.src/M000070.html" target="Code" class="method-signature"
|
1600
|
+
onclick="popupCode('LongDecimal.src/M000070.html');return false;">
|
1601
|
+
<span class="method-name">to_s_internal</span><span class="method-args">(b, sc)</span>
|
1602
|
+
</a>
|
1603
|
+
</div>
|
1604
|
+
|
1605
|
+
<div class="method-description">
|
1606
|
+
<p>
|
1607
|
+
internal helper method, converts self to string in any number system
|
1608
|
+
</p>
|
1609
|
+
</div>
|
1610
|
+
</div>
|
1611
|
+
|
1612
|
+
|
1613
|
+
</div>
|
1614
|
+
|
1615
|
+
|
1616
|
+
</div>
|
1617
|
+
|
1618
|
+
|
1619
|
+
<div id="validator-badges">
|
1620
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
1621
|
+
</div>
|
1622
|
+
|
1623
|
+
</body>
|
1624
|
+
</html>
|