prct09 0.0.1 → 1.0.0
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/.travis.yml +0 -0
- data/Gemfile +0 -0
- data/Guarfile +0 -0
- data/LICENSE.txt +0 -0
- data/README.md +0 -0
- data/Rakefile +0 -0
- data/bin/prct09 +0 -0
- data/doc/classes/Fraccion.html +365 -0
- data/doc/classes/Fraccion.src/M000024.html +19 -0
- data/doc/classes/Fraccion.src/M000025.html +18 -0
- data/doc/classes/Fraccion.src/M000026.html +18 -0
- data/doc/classes/Fraccion.src/M000027.html +20 -0
- data/doc/classes/Fraccion.src/M000028.html +18 -0
- data/doc/classes/Fraccion.src/M000029.html +18 -0
- data/doc/classes/Fraccion.src/M000030.html +18 -0
- data/doc/classes/Fraccion.src/M000031.html +18 -0
- data/doc/classes/Fraccion.src/M000032.html +18 -0
- data/doc/classes/Fraccion.src/M000033.html +18 -0
- data/doc/classes/Fraccion.src/M000034.html +30 -0
- data/doc/classes/Fraccion.src/M000035.html +18 -0
- data/doc/classes/Fraccion.src/M000036.html +18 -0
- data/doc/classes/Matriz.html +282 -0
- data/doc/classes/Matriz.src/M000015.html +20 -0
- data/doc/classes/Matriz.src/M000016.html +20 -0
- data/doc/classes/Matriz.src/M000017.html +17 -0
- data/doc/classes/Matriz.src/M000018.html +17 -0
- data/doc/classes/Matriz.src/M000019.html +17 -0
- data/doc/classes/Matriz.src/M000020.html +25 -0
- data/doc/classes/Matriz.src/M000021.html +32 -0
- data/doc/classes/Matriz.src/M000022.html +17 -0
- data/doc/classes/Matriz.src/M000023.html +17 -0
- data/doc/classes/Matriz_densa.html +199 -0
- data/doc/classes/Matriz_densa.src/M000010.html +42 -0
- data/doc/classes/Matriz_densa.src/M000011.html +42 -0
- data/doc/classes/Matriz_densa.src/M000012.html +44 -0
- data/doc/classes/Matriz_densa.src/M000013.html +29 -0
- data/doc/classes/Matriz_densa.src/M000014.html +29 -0
- data/doc/classes/Matriz_dispersa.html +269 -0
- data/doc/classes/Matriz_dispersa.src/M000002.html +29 -0
- data/doc/classes/Matriz_dispersa.src/M000003.html +34 -0
- data/doc/classes/Matriz_dispersa.src/M000004.html +52 -0
- data/doc/classes/Matriz_dispersa.src/M000005.html +52 -0
- data/doc/classes/Matriz_dispersa.src/M000006.html +48 -0
- data/doc/classes/Matriz_dispersa.src/M000007.html +29 -0
- data/doc/classes/Matriz_dispersa.src/M000008.html +31 -0
- data/doc/classes/Matriz_dispersa.src/M000009.html +31 -0
- data/doc/classes/Prct09.html +122 -0
- data/doc/classes/Test_Matriz.html +191 -0
- data/doc/classes/Test_Matriz.src/M000037.html +21 -0
- data/doc/classes/Test_Matriz.src/M000038.html +30 -0
- data/doc/classes/Test_Matriz.src/M000039.html +24 -0
- data/doc/classes/Test_Matriz.src/M000040.html +32 -0
- data/doc/created.rid +14 -0
- data/doc/files/lib/Fraccion_rb.html +101 -0
- data/doc/files/lib/Matriz_densa_rb.html +109 -0
- data/doc/files/lib/Matriz_dispersa_rb.html +109 -0
- data/doc/files/lib/Matriz_rb.html +108 -0
- data/doc/files/lib/mcd_rb.html +136 -0
- data/doc/files/lib/mcd_rb.src/M000001.html +22 -0
- data/doc/files/lib/prct09/version_rb.html +101 -0
- data/doc/files/lib/prct09_rb.html +108 -0
- data/doc/files/spec/Matriz_spec_rb.html +117 -0
- data/doc/files/test/tc_matriz_rb.html +112 -0
- data/doc/fr_class_index.html +32 -0
- data/doc/fr_file_index.html +35 -0
- data/doc/fr_method_index.html +66 -0
- data/doc/index.html +150 -0
- data/doc/rdoc-style.css +208 -0
- data/lib/Fraccion.rb +20 -14
- data/lib/Matriz.rb +13 -45
- data/lib/Matriz_densa.rb +30 -25
- data/lib/Matriz_dispersa.rb +40 -32
- data/lib/prct09/version.rb +1 -1
- data/lib/prct09.rb +0 -0
- data/prct09-0.0.1.gem +0 -0
- data/prct09.gemspec +0 -0
- data/spec/Matriz_spec.rb +21 -9
- data/test/tc_matriz.rb +5 -4
- metadata +64 -4
- data/.gitignore +0 -18
- data/lib/mcd.rb +0 -9
data/.travis.yml
CHANGED
File without changes
|
data/Gemfile
CHANGED
File without changes
|
data/Guarfile
CHANGED
File without changes
|
data/LICENSE.txt
CHANGED
File without changes
|
data/README.md
CHANGED
File without changes
|
data/Rakefile
CHANGED
File without changes
|
data/bin/prct09
CHANGED
File without changes
|
@@ -0,0 +1,365 @@
|
|
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: Fraccion</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">Fraccion</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../files/lib/Fraccion_rb.html">
|
59
|
+
lib/Fraccion.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
|
+
Object
|
69
|
+
</td>
|
70
|
+
</tr>
|
71
|
+
</table>
|
72
|
+
</div>
|
73
|
+
<!-- banner header -->
|
74
|
+
|
75
|
+
<div id="bodyContent">
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<div id="contextContent">
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
</div>
|
84
|
+
|
85
|
+
<div id="method-list">
|
86
|
+
<h3 class="section-bar">Methods</h3>
|
87
|
+
|
88
|
+
<div class="name-list">
|
89
|
+
<a href="#M000032">%</a>
|
90
|
+
<a href="#M000030">*</a>
|
91
|
+
<a href="#M000028">+</a>
|
92
|
+
<a href="#M000029">-</a>
|
93
|
+
<a href="#M000036">-@</a>
|
94
|
+
<a href="#M000031">/</a>
|
95
|
+
<a href="#M000033"><=></a>
|
96
|
+
<a href="#M000034">abs</a>
|
97
|
+
<a href="#M000027">coerce</a>
|
98
|
+
<a href="#M000026">imprimirFlotante</a>
|
99
|
+
<a href="#M000025">imprimirFraccion</a>
|
100
|
+
<a href="#M000024">new</a>
|
101
|
+
<a href="#M000035">reciprocal</a>
|
102
|
+
</div>
|
103
|
+
</div>
|
104
|
+
|
105
|
+
</div>
|
106
|
+
|
107
|
+
|
108
|
+
<!-- if includes -->
|
109
|
+
<div id="includes">
|
110
|
+
<h3 class="section-bar">Included Modules</h3>
|
111
|
+
|
112
|
+
<div id="includes-list">
|
113
|
+
<span class="include-name">Comparable</span>
|
114
|
+
</div>
|
115
|
+
</div>
|
116
|
+
|
117
|
+
<div id="section">
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
<div id="attribute-list">
|
124
|
+
<h3 class="section-bar">Attributes</h3>
|
125
|
+
|
126
|
+
<div class="name-list">
|
127
|
+
<table>
|
128
|
+
<tr class="top-aligned-row context-row">
|
129
|
+
<td class="context-item-name">d</td>
|
130
|
+
<td class="context-item-value"> [R] </td>
|
131
|
+
<td class="context-item-desc"></td>
|
132
|
+
</tr>
|
133
|
+
<tr class="top-aligned-row context-row">
|
134
|
+
<td class="context-item-name">n</td>
|
135
|
+
<td class="context-item-value"> [R] </td>
|
136
|
+
<td class="context-item-desc"></td>
|
137
|
+
</tr>
|
138
|
+
</table>
|
139
|
+
</div>
|
140
|
+
</div>
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
<!-- if method_list -->
|
145
|
+
<div id="methods">
|
146
|
+
<h3 class="section-bar">Public Class methods</h3>
|
147
|
+
|
148
|
+
<div id="method-M000024" class="method-detail">
|
149
|
+
<a name="M000024"></a>
|
150
|
+
|
151
|
+
<div class="method-heading">
|
152
|
+
<a href="Fraccion.src/M000024.html" target="Code" class="method-signature"
|
153
|
+
onclick="popupCode('Fraccion.src/M000024.html');return false;">
|
154
|
+
<span class="method-name">new</span><span class="method-args">(n, d)</span>
|
155
|
+
</a>
|
156
|
+
</div>
|
157
|
+
|
158
|
+
<div class="method-description">
|
159
|
+
<p>
|
160
|
+
Construccion
|
161
|
+
</p>
|
162
|
+
</div>
|
163
|
+
</div>
|
164
|
+
|
165
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
166
|
+
|
167
|
+
<div id="method-M000032" class="method-detail">
|
168
|
+
<a name="M000032"></a>
|
169
|
+
|
170
|
+
<div class="method-heading">
|
171
|
+
<a href="Fraccion.src/M000032.html" target="Code" class="method-signature"
|
172
|
+
onclick="popupCode('Fraccion.src/M000032.html');return false;">
|
173
|
+
<span class="method-name">%</span><span class="method-args">(other)</span>
|
174
|
+
</a>
|
175
|
+
</div>
|
176
|
+
|
177
|
+
<div class="method-description">
|
178
|
+
</div>
|
179
|
+
</div>
|
180
|
+
|
181
|
+
<div id="method-M000030" class="method-detail">
|
182
|
+
<a name="M000030"></a>
|
183
|
+
|
184
|
+
<div class="method-heading">
|
185
|
+
<a href="Fraccion.src/M000030.html" target="Code" class="method-signature"
|
186
|
+
onclick="popupCode('Fraccion.src/M000030.html');return false;">
|
187
|
+
<span class="method-name">*</span><span class="method-args">(other)</span>
|
188
|
+
</a>
|
189
|
+
</div>
|
190
|
+
|
191
|
+
<div class="method-description">
|
192
|
+
</div>
|
193
|
+
</div>
|
194
|
+
|
195
|
+
<div id="method-M000028" class="method-detail">
|
196
|
+
<a name="M000028"></a>
|
197
|
+
|
198
|
+
<div class="method-heading">
|
199
|
+
<a href="Fraccion.src/M000028.html" target="Code" class="method-signature"
|
200
|
+
onclick="popupCode('Fraccion.src/M000028.html');return false;">
|
201
|
+
<span class="method-name">+</span><span class="method-args">(other)</span>
|
202
|
+
</a>
|
203
|
+
</div>
|
204
|
+
|
205
|
+
<div class="method-description">
|
206
|
+
<p>
|
207
|
+
Sobrecarga de operadores
|
208
|
+
</p>
|
209
|
+
</div>
|
210
|
+
</div>
|
211
|
+
|
212
|
+
<div id="method-M000029" class="method-detail">
|
213
|
+
<a name="M000029"></a>
|
214
|
+
|
215
|
+
<div class="method-heading">
|
216
|
+
<a href="Fraccion.src/M000029.html" target="Code" class="method-signature"
|
217
|
+
onclick="popupCode('Fraccion.src/M000029.html');return false;">
|
218
|
+
<span class="method-name">-</span><span class="method-args">(other)</span>
|
219
|
+
</a>
|
220
|
+
</div>
|
221
|
+
|
222
|
+
<div class="method-description">
|
223
|
+
</div>
|
224
|
+
</div>
|
225
|
+
|
226
|
+
<div id="method-M000036" class="method-detail">
|
227
|
+
<a name="M000036"></a>
|
228
|
+
|
229
|
+
<div class="method-heading">
|
230
|
+
<a href="Fraccion.src/M000036.html" target="Code" class="method-signature"
|
231
|
+
onclick="popupCode('Fraccion.src/M000036.html');return false;">
|
232
|
+
<span class="method-name">-@</span><span class="method-args">()</span>
|
233
|
+
</a>
|
234
|
+
</div>
|
235
|
+
|
236
|
+
<div class="method-description">
|
237
|
+
<p>
|
238
|
+
opuesta de una fraccion
|
239
|
+
</p>
|
240
|
+
</div>
|
241
|
+
</div>
|
242
|
+
|
243
|
+
<div id="method-M000031" class="method-detail">
|
244
|
+
<a name="M000031"></a>
|
245
|
+
|
246
|
+
<div class="method-heading">
|
247
|
+
<a href="Fraccion.src/M000031.html" target="Code" class="method-signature"
|
248
|
+
onclick="popupCode('Fraccion.src/M000031.html');return false;">
|
249
|
+
<span class="method-name">/</span><span class="method-args">(other)</span>
|
250
|
+
</a>
|
251
|
+
</div>
|
252
|
+
|
253
|
+
<div class="method-description">
|
254
|
+
</div>
|
255
|
+
</div>
|
256
|
+
|
257
|
+
<div id="method-M000033" class="method-detail">
|
258
|
+
<a name="M000033"></a>
|
259
|
+
|
260
|
+
<div class="method-heading">
|
261
|
+
<a href="Fraccion.src/M000033.html" target="Code" class="method-signature"
|
262
|
+
onclick="popupCode('Fraccion.src/M000033.html');return false;">
|
263
|
+
<span class="method-name"><=></span><span class="method-args">(other)</span>
|
264
|
+
</a>
|
265
|
+
</div>
|
266
|
+
|
267
|
+
<div class="method-description">
|
268
|
+
</div>
|
269
|
+
</div>
|
270
|
+
|
271
|
+
<div id="method-M000034" class="method-detail">
|
272
|
+
<a name="M000034"></a>
|
273
|
+
|
274
|
+
<div class="method-heading">
|
275
|
+
<a href="Fraccion.src/M000034.html" target="Code" class="method-signature"
|
276
|
+
onclick="popupCode('Fraccion.src/M000034.html');return false;">
|
277
|
+
<span class="method-name">abs</span><span class="method-args">()</span>
|
278
|
+
</a>
|
279
|
+
</div>
|
280
|
+
|
281
|
+
<div class="method-description">
|
282
|
+
<p>
|
283
|
+
valor absoluto
|
284
|
+
</p>
|
285
|
+
</div>
|
286
|
+
</div>
|
287
|
+
|
288
|
+
<div id="method-M000027" class="method-detail">
|
289
|
+
<a name="M000027"></a>
|
290
|
+
|
291
|
+
<div class="method-heading">
|
292
|
+
<a href="Fraccion.src/M000027.html" target="Code" class="method-signature"
|
293
|
+
onclick="popupCode('Fraccion.src/M000027.html');return false;">
|
294
|
+
<span class="method-name">coerce</span><span class="method-args">(other)</span>
|
295
|
+
</a>
|
296
|
+
</div>
|
297
|
+
|
298
|
+
<div class="method-description">
|
299
|
+
</div>
|
300
|
+
</div>
|
301
|
+
|
302
|
+
<div id="method-M000026" class="method-detail">
|
303
|
+
<a name="M000026"></a>
|
304
|
+
|
305
|
+
<div class="method-heading">
|
306
|
+
<a href="Fraccion.src/M000026.html" target="Code" class="method-signature"
|
307
|
+
onclick="popupCode('Fraccion.src/M000026.html');return false;">
|
308
|
+
<span class="method-name">imprimirFlotante</span><span class="method-args">()</span>
|
309
|
+
</a>
|
310
|
+
</div>
|
311
|
+
|
312
|
+
<div class="method-description">
|
313
|
+
<p>
|
314
|
+
Pasar a flotante el objeto <a href="Fraccion.html">Fraccion</a>
|
315
|
+
</p>
|
316
|
+
</div>
|
317
|
+
</div>
|
318
|
+
|
319
|
+
<div id="method-M000025" class="method-detail">
|
320
|
+
<a name="M000025"></a>
|
321
|
+
|
322
|
+
<div class="method-heading">
|
323
|
+
<a href="Fraccion.src/M000025.html" target="Code" class="method-signature"
|
324
|
+
onclick="popupCode('Fraccion.src/M000025.html');return false;">
|
325
|
+
<span class="method-name">imprimirFraccion</span><span class="method-args">()</span>
|
326
|
+
</a>
|
327
|
+
</div>
|
328
|
+
|
329
|
+
<div class="method-description">
|
330
|
+
<p>
|
331
|
+
Pasar a string el objeto <a href="Fraccion.html">Fraccion</a>
|
332
|
+
</p>
|
333
|
+
</div>
|
334
|
+
</div>
|
335
|
+
|
336
|
+
<div id="method-M000035" class="method-detail">
|
337
|
+
<a name="M000035"></a>
|
338
|
+
|
339
|
+
<div class="method-heading">
|
340
|
+
<a href="Fraccion.src/M000035.html" target="Code" class="method-signature"
|
341
|
+
onclick="popupCode('Fraccion.src/M000035.html');return false;">
|
342
|
+
<span class="method-name">reciprocal</span><span class="method-args">()</span>
|
343
|
+
</a>
|
344
|
+
</div>
|
345
|
+
|
346
|
+
<div class="method-description">
|
347
|
+
<p>
|
348
|
+
inverso de una fraccion
|
349
|
+
</p>
|
350
|
+
</div>
|
351
|
+
</div>
|
352
|
+
|
353
|
+
|
354
|
+
</div>
|
355
|
+
|
356
|
+
|
357
|
+
</div>
|
358
|
+
|
359
|
+
|
360
|
+
<div id="validator-badges">
|
361
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
362
|
+
</div>
|
363
|
+
|
364
|
+
</body>
|
365
|
+
</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>new (Fraccion)</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/Fraccion.rb, line 17</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">n</span>, <span class="ruby-identifier">d</span>)
|
15
|
+
<span class="ruby-ivar">@n</span> = <span class="ruby-identifier">n</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">mcd</span>(<span class="ruby-identifier">n</span>,<span class="ruby-identifier">d</span>)
|
16
|
+
<span class="ruby-ivar">@d</span> = <span class="ruby-identifier">d</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">mcd</span>(<span class="ruby-identifier">n</span>,<span class="ruby-identifier">d</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>imprimirFraccion (Fraccion)</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/Fraccion.rb, line 23</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">imprimirFraccion</span>
|
15
|
+
<span class="ruby-node">"#{@n}/#{@d}"</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>imprimirFlotante (Fraccion)</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/Fraccion.rb, line 28</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">imprimirFlotante</span>
|
15
|
+
<span class="ruby-ivar">@n</span>.<span class="ruby-identifier">to_f</span><span class="ruby-operator">/</span><span class="ruby-ivar">@d</span>.<span class="ruby-identifier">to_f</span>
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,20 @@
|
|
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>coerce (Fraccion)</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/Fraccion.rb, line 32</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">coerce</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">is_a?</span>(<span class="ruby-constant">Numeric</span>))
|
16
|
+
[<span class="ruby-constant">Fraccion</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">other</span>.<span class="ruby-identifier">to_i</span>,<span class="ruby-value">1</span>),<span class="ruby-keyword kw">self</span>]
|
17
|
+
<span class="ruby-keyword kw">end</span>
|
18
|
+
<span class="ruby-keyword kw">end</span></pre>
|
19
|
+
</body>
|
20
|
+
</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>+ (Fraccion)</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/Fraccion.rb, line 40</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">+</span> (<span class="ruby-identifier">other</span>)
|
15
|
+
<span class="ruby-constant">Fraccion</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@n</span><span class="ruby-operator">*</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">d</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">n</span><span class="ruby-operator">*</span><span class="ruby-ivar">@d</span>, <span class="ruby-ivar">@d</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">d</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>- (Fraccion)</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/Fraccion.rb, line 44</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">-</span> (<span class="ruby-identifier">other</span>)
|
15
|
+
<span class="ruby-constant">Fraccion</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@n</span><span class="ruby-operator">*</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">d</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">n</span><span class="ruby-operator">*</span><span class="ruby-ivar">@d</span>, <span class="ruby-ivar">@d</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">d</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>* (Fraccion)</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/Fraccion.rb, line 48</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">*</span> (<span class="ruby-identifier">other</span>)
|
15
|
+
<span class="ruby-constant">Fraccion</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@n</span><span class="ruby-operator">*</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">n</span>, <span class="ruby-ivar">@d</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">d</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>/ (Fraccion)</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/Fraccion.rb, line 52</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">/</span> (<span class="ruby-identifier">other</span>)
|
15
|
+
<span class="ruby-constant">Fraccion</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@n</span><span class="ruby-operator">*</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">d</span>, <span class="ruby-ivar">@d</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">n</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>% (Fraccion)</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/Fraccion.rb, line 56</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">%</span> (<span class="ruby-identifier">other</span>)
|
15
|
+
<span class="ruby-constant">Fraccion</span>.<span class="ruby-identifier">new</span>((<span class="ruby-identifier">imprimirFlotante</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">imprimirFlotante</span><span class="ruby-operator">*</span><span class="ruby-value">1000</span>).<span class="ruby-identifier">to_i</span>, <span class="ruby-value">1000</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><=> (Fraccion)</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/Fraccion.rb, line 60</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">imprimirFlotante</span> <span class="ruby-operator"><=></span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">imprimirFlotante</span>
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,30 @@
|
|
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>abs (Fraccion)</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/Fraccion.rb, line 65</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">abs</span>
|
15
|
+
<span class="ruby-keyword kw">if</span> (<span class="ruby-ivar">@n</span> <span class="ruby-operator"><</span> <span class="ruby-value">0</span>) <span class="ruby-operator">^</span> (<span class="ruby-ivar">@d</span> <span class="ruby-operator"><</span> <span class="ruby-value">0</span>)
|
16
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@n</span> <span class="ruby-operator"><</span> <span class="ruby-value">0</span>
|
17
|
+
<span class="ruby-constant">Fraccion</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@n</span><span class="ruby-operator">*</span><span class="ruby-value">-1</span>, <span class="ruby-ivar">@d</span>)
|
18
|
+
<span class="ruby-keyword kw">else</span>
|
19
|
+
<span class="ruby-constant">Fraccion</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@n</span>, <span class="ruby-ivar">@d</span><span class="ruby-operator">*</span><span class="ruby-value">-1</span>)
|
20
|
+
<span class="ruby-keyword kw">end</span>
|
21
|
+
|
22
|
+
<span class="ruby-keyword kw">elsif</span> (<span class="ruby-ivar">@n</span> <span class="ruby-operator"><</span> <span class="ruby-value">0</span>) <span class="ruby-operator">&&</span> (<span class="ruby-ivar">@d</span> <span class="ruby-operator"><</span> <span class="ruby-value">0</span>)
|
23
|
+
<span class="ruby-constant">Fraccion</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@n</span><span class="ruby-operator">*</span><span class="ruby-value">-1</span>, <span class="ruby-ivar">@d</span><span class="ruby-operator">*</span><span class="ruby-value">-1</span>)
|
24
|
+
|
25
|
+
<span class="ruby-keyword kw">else</span>
|
26
|
+
<span class="ruby-constant">Fraccion</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@n</span>, <span class="ruby-ivar">@d</span>)
|
27
|
+
<span class="ruby-keyword kw">end</span>
|
28
|
+
<span class="ruby-keyword kw">end</span></pre>
|
29
|
+
</body>
|
30
|
+
</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>reciprocal (Fraccion)</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/Fraccion.rb, line 83</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reciprocal</span>
|
15
|
+
<span class="ruby-constant">Fraccion</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@d</span>, <span class="ruby-ivar">@n</span>)
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|