code-ruby 4.0.0 → 4.0.1
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.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/bin/code +8 -5
- data/lib/code/concerns/shared.rb +102 -98
- data/lib/code/format.rb +23 -19
- data/lib/code/network.rb +23 -28
- data/lib/code/node/call.rb +9 -8
- data/lib/code/node/code.rb +1 -1
- data/lib/code/node/list.rb +10 -8
- data/lib/code/node/square_bracket.rb +4 -2
- data/lib/code/object/boolean.rb +13 -17
- data/lib/code/object/class.rb +32 -27
- data/lib/code/object/code.rb +2 -9
- data/lib/code/object/context.rb +4 -2
- data/lib/code/object/cryptography.rb +12 -6
- data/lib/code/object/date.rb +910 -449
- data/lib/code/object/decimal.rb +229 -856
- data/lib/code/object/dictionary.rb +113 -42
- data/lib/code/object/duration.rb +3 -7
- data/lib/code/object/function.rb +64 -40
- data/lib/code/object/global.rb +121 -208
- data/lib/code/object/html.rb +4 -2
- data/lib/code/object/http.rb +32 -26
- data/lib/code/object/ics.rb +2 -1
- data/lib/code/object/identifier_list.rb +16 -11
- data/lib/code/object/integer.rb +270 -942
- data/lib/code/object/json.rb +8 -3
- data/lib/code/object/list.rb +97 -109
- data/lib/code/object/nothing.rb +11 -11
- data/lib/code/object/number.rb +20 -10
- data/lib/code/object/parameter.rb +18 -9
- data/lib/code/object/range.rb +62 -108
- data/lib/code/object/smtp.rb +20 -12
- data/lib/code/object/string.rb +52 -28
- data/lib/code/object/super.rb +2 -1
- data/lib/code/object/time.rb +1146 -572
- data/lib/code/object/url.rb +4 -2
- data/lib/code/object.rb +119 -80
- data/lib/code/parser.rb +34 -32
- metadata +1 -1
data/lib/code/object/decimal.rb
CHANGED
|
@@ -5,211 +5,134 @@ class Code
|
|
|
5
5
|
class Decimal < Number
|
|
6
6
|
CLASS_DOCUMENTATION = {
|
|
7
7
|
name: "Decimal",
|
|
8
|
-
description:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"Decimal.new(\"2.5\") + 1",
|
|
12
|
-
"1.5.days"
|
|
13
|
-
]
|
|
8
|
+
description:
|
|
9
|
+
"represents fractional numbers with arithmetic, rounding, formatting, duration helpers, and numeric predicates.",
|
|
10
|
+
examples: ["Decimal.new(1.5)", "Decimal.new(\"2.5\") + 1", "1.5.days"]
|
|
14
11
|
}.freeze
|
|
15
12
|
INSTANCE_FUNCTIONS = {
|
|
16
13
|
"%" => {
|
|
17
14
|
name: "%",
|
|
18
15
|
description: "returns the decimal modulo another number.",
|
|
19
|
-
examples: [
|
|
20
|
-
"5.5 % 2",
|
|
21
|
-
"4.0 % 2",
|
|
22
|
-
"7.5 % 3"
|
|
23
|
-
]
|
|
16
|
+
examples: ["5.5 % 2", "4.0 % 2", "7.5 % 3"]
|
|
24
17
|
},
|
|
25
18
|
"modulo" => {
|
|
26
19
|
name: "modulo",
|
|
27
20
|
description: "returns the decimal modulo another number.",
|
|
28
|
-
examples: [
|
|
29
|
-
"5.5.modulo(2)",
|
|
30
|
-
"4.0.modulo(2)",
|
|
31
|
-
"7.5.modulo(3)"
|
|
32
|
-
]
|
|
21
|
+
examples: %w[5.5.modulo(2) 4.0.modulo(2) 7.5.modulo(3)]
|
|
33
22
|
},
|
|
34
23
|
"&" => {
|
|
35
24
|
name: "&",
|
|
36
|
-
description:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"4.0 & 1",
|
|
40
|
-
"7.0 & 2"
|
|
41
|
-
]
|
|
25
|
+
description:
|
|
26
|
+
"returns the bitwise and of the decimal integer value and another number.",
|
|
27
|
+
examples: ["5.5 & 3", "4.0 & 1", "7.0 & 2"]
|
|
42
28
|
},
|
|
43
29
|
"bitwise_and" => {
|
|
44
30
|
name: "bitwise_and",
|
|
45
|
-
description:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"4.0.bitwise_and(1)",
|
|
49
|
-
"7.0.bitwise_and(2)"
|
|
50
|
-
]
|
|
31
|
+
description:
|
|
32
|
+
"returns the bitwise and of the decimal integer value and another number.",
|
|
33
|
+
examples: %w[5.5.bitwise_and(3) 4.0.bitwise_and(1) 7.0.bitwise_and(2)]
|
|
51
34
|
},
|
|
52
35
|
"*" => {
|
|
53
36
|
name: "*",
|
|
54
37
|
description: "returns the decimal multiplied by another number.",
|
|
55
|
-
examples: [
|
|
56
|
-
"2.5 * 2",
|
|
57
|
-
"1.5 * 3",
|
|
58
|
-
"4.0 * 2"
|
|
59
|
-
]
|
|
38
|
+
examples: ["2.5 * 2", "1.5 * 3", "4.0 * 2"]
|
|
60
39
|
},
|
|
61
40
|
"multiplication" => {
|
|
62
41
|
name: "multiplication",
|
|
63
42
|
description: "returns the decimal multiplied by another number.",
|
|
64
|
-
examples: [
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
43
|
+
examples: %w[
|
|
44
|
+
2.5.multiplication(2)
|
|
45
|
+
1.5.multiplication(3)
|
|
46
|
+
4.0.multiplication(2)
|
|
68
47
|
]
|
|
69
48
|
},
|
|
70
49
|
"**" => {
|
|
71
50
|
name: "**",
|
|
72
51
|
description: "returns the decimal raised to a power.",
|
|
73
|
-
examples: [
|
|
74
|
-
"2.5 ** 2",
|
|
75
|
-
"4.0 ** 2",
|
|
76
|
-
"9.0 ** 0.5"
|
|
77
|
-
]
|
|
52
|
+
examples: ["2.5 ** 2", "4.0 ** 2", "9.0 ** 0.5"]
|
|
78
53
|
},
|
|
79
54
|
"power" => {
|
|
80
55
|
name: "power",
|
|
81
56
|
description: "returns the decimal raised to a power.",
|
|
82
|
-
examples: [
|
|
83
|
-
"2.5.power(2)",
|
|
84
|
-
"4.0.power(2)",
|
|
85
|
-
"9.0.power(0.5)"
|
|
86
|
-
]
|
|
57
|
+
examples: %w[2.5.power(2) 4.0.power(2) 9.0.power(0.5)]
|
|
87
58
|
},
|
|
88
59
|
"+" => {
|
|
89
60
|
name: "+",
|
|
90
|
-
description:
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
"1.5 + 2.5",
|
|
94
|
-
"+1.5"
|
|
95
|
-
]
|
|
61
|
+
description:
|
|
62
|
+
"returns the decimal itself when unary, adds numbers, or joins other values as text.",
|
|
63
|
+
examples: ["1.5 + 2", "1.5 + 2.5", "+1.5"]
|
|
96
64
|
},
|
|
97
65
|
"plus" => {
|
|
98
66
|
name: "plus",
|
|
99
67
|
description: "adds numbers or joins non-numeric values as text.",
|
|
100
|
-
examples: [
|
|
101
|
-
"1.5.plus(2)",
|
|
102
|
-
"1.5.plus(2.5)",
|
|
103
|
-
"1.5.plus(:x)"
|
|
104
|
-
]
|
|
68
|
+
examples: %w[1.5.plus(2) 1.5.plus(2.5) 1.5.plus(:x)]
|
|
105
69
|
},
|
|
106
70
|
"-" => {
|
|
107
71
|
name: "-",
|
|
108
|
-
description:
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
"5.5 - 2.5",
|
|
112
|
-
"-5.5"
|
|
113
|
-
]
|
|
72
|
+
description:
|
|
73
|
+
"returns the decimal negated when unary or minus another number.",
|
|
74
|
+
examples: ["5.5 - 1", "5.5 - 2.5", "-5.5"]
|
|
114
75
|
},
|
|
115
76
|
"minus" => {
|
|
116
77
|
name: "minus",
|
|
117
78
|
description: "returns the decimal minus another number.",
|
|
118
|
-
examples: [
|
|
119
|
-
"5.5.minus(1)",
|
|
120
|
-
"5.5.minus(2.5)",
|
|
121
|
-
"1.5.minus(3)"
|
|
122
|
-
]
|
|
79
|
+
examples: %w[5.5.minus(1) 5.5.minus(2.5) 1.5.minus(3)]
|
|
123
80
|
},
|
|
124
81
|
"/" => {
|
|
125
82
|
name: "/",
|
|
126
83
|
description: "returns the decimal divided by another number.",
|
|
127
|
-
examples: [
|
|
128
|
-
"5.5 / 2",
|
|
129
|
-
"4.0 / 2",
|
|
130
|
-
"7.5 / 3"
|
|
131
|
-
]
|
|
84
|
+
examples: ["5.5 / 2", "4.0 / 2", "7.5 / 3"]
|
|
132
85
|
},
|
|
133
86
|
"division" => {
|
|
134
87
|
name: "division",
|
|
135
88
|
description: "returns the decimal divided by another number.",
|
|
136
|
-
examples: [
|
|
137
|
-
"5.5.division(2)",
|
|
138
|
-
"4.0.division(2)",
|
|
139
|
-
"7.5.division(3)"
|
|
140
|
-
]
|
|
89
|
+
examples: %w[5.5.division(2) 4.0.division(2) 7.5.division(3)]
|
|
141
90
|
},
|
|
142
91
|
"decimal_divide" => {
|
|
143
92
|
name: "decimal_divide",
|
|
144
93
|
description: "returns the decimal divided by another number.",
|
|
145
|
-
examples: [
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
94
|
+
examples: %w[
|
|
95
|
+
5.5.decimal_divide(2)
|
|
96
|
+
4.0.decimal_divide(2)
|
|
97
|
+
7.5.decimal_divide(3)
|
|
149
98
|
]
|
|
150
99
|
},
|
|
151
100
|
"<<" => {
|
|
152
101
|
name: "<<",
|
|
153
102
|
description: "returns the decimal integer value shifted left.",
|
|
154
|
-
examples: [
|
|
155
|
-
"5.5 << 1",
|
|
156
|
-
"4.0 << 2",
|
|
157
|
-
"1.0 << 3"
|
|
158
|
-
]
|
|
103
|
+
examples: ["5.5 << 1", "4.0 << 2", "1.0 << 3"]
|
|
159
104
|
},
|
|
160
105
|
"left_shift" => {
|
|
161
106
|
name: "left_shift",
|
|
162
107
|
description: "returns the decimal integer value shifted left.",
|
|
163
|
-
examples: [
|
|
164
|
-
"5.5.left_shift(1)",
|
|
165
|
-
"4.0.left_shift(2)",
|
|
166
|
-
"1.0.left_shift(3)"
|
|
167
|
-
]
|
|
108
|
+
examples: %w[5.5.left_shift(1) 4.0.left_shift(2) 1.0.left_shift(3)]
|
|
168
109
|
},
|
|
169
110
|
">>" => {
|
|
170
111
|
name: ">>",
|
|
171
112
|
description: "returns the decimal integer value shifted right.",
|
|
172
|
-
examples: [
|
|
173
|
-
"5.5 >> 1",
|
|
174
|
-
"4.0 >> 1",
|
|
175
|
-
"8.0 >> 2"
|
|
176
|
-
]
|
|
113
|
+
examples: ["5.5 >> 1", "4.0 >> 1", "8.0 >> 2"]
|
|
177
114
|
},
|
|
178
115
|
"right_shift" => {
|
|
179
116
|
name: "right_shift",
|
|
180
117
|
description: "returns the decimal integer value shifted right.",
|
|
181
|
-
examples: [
|
|
182
|
-
"5.5.right_shift(1)",
|
|
183
|
-
"4.0.right_shift(1)",
|
|
184
|
-
"8.0.right_shift(2)"
|
|
185
|
-
]
|
|
118
|
+
examples: %w[5.5.right_shift(1) 4.0.right_shift(1) 8.0.right_shift(2)]
|
|
186
119
|
},
|
|
187
120
|
"^" => {
|
|
188
121
|
name: "^",
|
|
189
|
-
description:
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
"4.0 ^ 1",
|
|
193
|
-
"7.0 ^ 2"
|
|
194
|
-
]
|
|
122
|
+
description:
|
|
123
|
+
"returns the bitwise xor of the decimal integer value and another number.",
|
|
124
|
+
examples: ["5.5 ^ 3", "4.0 ^ 1", "7.0 ^ 2"]
|
|
195
125
|
},
|
|
196
126
|
"bitwise_xor" => {
|
|
197
127
|
name: "bitwise_xor",
|
|
198
|
-
description:
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
"4.0.bitwise_xor(1)",
|
|
202
|
-
"7.0.bitwise_xor(2)"
|
|
203
|
-
]
|
|
128
|
+
description:
|
|
129
|
+
"returns the bitwise xor of the decimal integer value and another number.",
|
|
130
|
+
examples: %w[5.5.bitwise_xor(3) 4.0.bitwise_xor(1) 7.0.bitwise_xor(2)]
|
|
204
131
|
},
|
|
205
132
|
"abs" => {
|
|
206
133
|
name: "abs",
|
|
207
134
|
description: "returns the absolute value of the decimal.",
|
|
208
|
-
examples: [
|
|
209
|
-
"-1.5.abs",
|
|
210
|
-
"1.5.abs",
|
|
211
|
-
"0.0.abs"
|
|
212
|
-
]
|
|
135
|
+
examples: %w[-1.5.abs 1.5.abs 0.0.abs]
|
|
213
136
|
},
|
|
214
137
|
"between?" => {
|
|
215
138
|
name: "between?",
|
|
@@ -223,1325 +146,772 @@ class Code
|
|
|
223
146
|
"clamp" => {
|
|
224
147
|
name: "clamp",
|
|
225
148
|
description: "returns the decimal constrained between two bounds.",
|
|
226
|
-
examples: [
|
|
227
|
-
"5.5.clamp(1, 3)",
|
|
228
|
-
"0.5.clamp(1, 3)",
|
|
229
|
-
"2.5.clamp(1, 3)"
|
|
230
|
-
]
|
|
149
|
+
examples: ["5.5.clamp(1, 3)", "0.5.clamp(1, 3)", "2.5.clamp(1, 3)"]
|
|
231
150
|
},
|
|
232
151
|
"divide" => {
|
|
233
152
|
name: "divide",
|
|
234
|
-
description:
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
"10.5.divide(3)",
|
|
238
|
-
"9.5.divide(2)"
|
|
239
|
-
]
|
|
153
|
+
description:
|
|
154
|
+
"returns integer division of the decimal by another number.",
|
|
155
|
+
examples: %w[5.5.divide(2) 10.5.divide(3) 9.5.divide(2)]
|
|
240
156
|
},
|
|
241
157
|
"divide_modulo" => {
|
|
242
158
|
name: "divide_modulo",
|
|
243
159
|
description: "returns integer division and modulo as a list.",
|
|
244
|
-
examples: [
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
160
|
+
examples: %w[
|
|
161
|
+
5.5.divide_modulo(2)
|
|
162
|
+
10.5.divide_modulo(3)
|
|
163
|
+
9.5.divide_modulo(2)
|
|
248
164
|
]
|
|
249
165
|
},
|
|
250
166
|
"ceil" => {
|
|
251
167
|
name: "ceil",
|
|
252
168
|
description: "returns the decimal rounded up.",
|
|
253
|
-
examples: [
|
|
254
|
-
"1.2.ceil",
|
|
255
|
-
"1.234.ceil(2)",
|
|
256
|
-
"-1.2.ceil"
|
|
257
|
-
]
|
|
169
|
+
examples: %w[1.2.ceil 1.234.ceil(2) -1.2.ceil]
|
|
258
170
|
},
|
|
259
171
|
"day" => {
|
|
260
172
|
name: "day",
|
|
261
173
|
description: "returns a duration of this many days.",
|
|
262
|
-
examples: [
|
|
263
|
-
"1.5.day",
|
|
264
|
-
"2.0.day",
|
|
265
|
-
"0.5.day"
|
|
266
|
-
]
|
|
174
|
+
examples: %w[1.5.day 2.0.day 0.5.day]
|
|
267
175
|
},
|
|
268
176
|
"days" => {
|
|
269
177
|
name: "days",
|
|
270
178
|
description: "returns a duration of this many days.",
|
|
271
|
-
examples: [
|
|
272
|
-
"1.5.days",
|
|
273
|
-
"2.0.days",
|
|
274
|
-
"0.5.days"
|
|
275
|
-
]
|
|
179
|
+
examples: %w[1.5.days 2.0.days 0.5.days]
|
|
276
180
|
},
|
|
277
181
|
"floor" => {
|
|
278
182
|
name: "floor",
|
|
279
183
|
description: "returns the decimal rounded down.",
|
|
280
|
-
examples: [
|
|
281
|
-
"1.8.floor",
|
|
282
|
-
"1.234.floor(2)",
|
|
283
|
-
"-1.2.floor"
|
|
284
|
-
]
|
|
184
|
+
examples: %w[1.8.floor 1.234.floor(2) -1.2.floor]
|
|
285
185
|
},
|
|
286
186
|
"hour" => {
|
|
287
187
|
name: "hour",
|
|
288
188
|
description: "returns a duration of this many hours.",
|
|
289
|
-
examples: [
|
|
290
|
-
"1.5.hour",
|
|
291
|
-
"2.0.hour",
|
|
292
|
-
"0.5.hour"
|
|
293
|
-
]
|
|
189
|
+
examples: %w[1.5.hour 2.0.hour 0.5.hour]
|
|
294
190
|
},
|
|
295
191
|
"hours" => {
|
|
296
192
|
name: "hours",
|
|
297
193
|
description: "returns a duration of this many hours.",
|
|
298
|
-
examples: [
|
|
299
|
-
"1.5.hours",
|
|
300
|
-
"2.0.hours",
|
|
301
|
-
"0.5.hours"
|
|
302
|
-
]
|
|
194
|
+
examples: %w[1.5.hours 2.0.hours 0.5.hours]
|
|
303
195
|
},
|
|
304
196
|
"minute" => {
|
|
305
197
|
name: "minute",
|
|
306
198
|
description: "returns a duration of this many minutes.",
|
|
307
|
-
examples: [
|
|
308
|
-
"1.5.minute",
|
|
309
|
-
"2.0.minute",
|
|
310
|
-
"0.5.minute"
|
|
311
|
-
]
|
|
199
|
+
examples: %w[1.5.minute 2.0.minute 0.5.minute]
|
|
312
200
|
},
|
|
313
201
|
"minutes" => {
|
|
314
202
|
name: "minutes",
|
|
315
203
|
description: "returns a duration of this many minutes.",
|
|
316
|
-
examples: [
|
|
317
|
-
"1.5.minutes",
|
|
318
|
-
"2.0.minutes",
|
|
319
|
-
"0.5.minutes"
|
|
320
|
-
]
|
|
204
|
+
examples: %w[1.5.minutes 2.0.minutes 0.5.minutes]
|
|
321
205
|
},
|
|
322
206
|
"month" => {
|
|
323
207
|
name: "month",
|
|
324
208
|
description: "returns a duration of this many months.",
|
|
325
|
-
examples: [
|
|
326
|
-
"1.5.month",
|
|
327
|
-
"2.0.month",
|
|
328
|
-
"0.5.month"
|
|
329
|
-
]
|
|
209
|
+
examples: %w[1.5.month 2.0.month 0.5.month]
|
|
330
210
|
},
|
|
331
211
|
"months" => {
|
|
332
212
|
name: "months",
|
|
333
213
|
description: "returns a duration of this many months.",
|
|
334
|
-
examples: [
|
|
335
|
-
"1.5.months",
|
|
336
|
-
"2.0.months",
|
|
337
|
-
"0.5.months"
|
|
338
|
-
]
|
|
214
|
+
examples: %w[1.5.months 2.0.months 0.5.months]
|
|
339
215
|
},
|
|
340
216
|
"next_decimal" => {
|
|
341
217
|
name: "next_decimal",
|
|
342
218
|
description: "alias for next.",
|
|
343
|
-
examples: [
|
|
344
|
-
"1.5.next_decimal",
|
|
345
|
-
"0.0.next_decimal",
|
|
346
|
-
"-1.5.next_decimal"
|
|
347
|
-
]
|
|
219
|
+
examples: %w[1.5.next_decimal 0.0.next_decimal -1.5.next_decimal]
|
|
348
220
|
},
|
|
349
221
|
"previous_decimal" => {
|
|
350
222
|
name: "previous_decimal",
|
|
351
223
|
description: "alias for previous.",
|
|
352
|
-
examples: [
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
224
|
+
examples: %w[
|
|
225
|
+
1.5.previous_decimal
|
|
226
|
+
0.0.previous_decimal
|
|
227
|
+
-1.5.previous_decimal
|
|
356
228
|
]
|
|
357
229
|
},
|
|
358
230
|
"round" => {
|
|
359
231
|
name: "round",
|
|
360
232
|
description: "returns the decimal rounded to a precision.",
|
|
361
|
-
examples: [
|
|
362
|
-
"1.5.round",
|
|
363
|
-
"1.234.round(2)",
|
|
364
|
-
"-1.5.round"
|
|
365
|
-
]
|
|
233
|
+
examples: %w[1.5.round 1.234.round(2) -1.5.round]
|
|
366
234
|
},
|
|
367
235
|
"second" => {
|
|
368
236
|
name: "second",
|
|
369
237
|
description: "returns a duration of this many seconds.",
|
|
370
|
-
examples: [
|
|
371
|
-
"1.5.second",
|
|
372
|
-
"2.0.second",
|
|
373
|
-
"0.5.second"
|
|
374
|
-
]
|
|
238
|
+
examples: %w[1.5.second 2.0.second 0.5.second]
|
|
375
239
|
},
|
|
376
240
|
"seconds" => {
|
|
377
241
|
name: "seconds",
|
|
378
242
|
description: "returns a duration of this many seconds.",
|
|
379
|
-
examples: [
|
|
380
|
-
"1.5.seconds",
|
|
381
|
-
"2.0.seconds",
|
|
382
|
-
"0.5.seconds"
|
|
383
|
-
]
|
|
243
|
+
examples: %w[1.5.seconds 2.0.seconds 0.5.seconds]
|
|
384
244
|
},
|
|
385
245
|
"sqrt" => {
|
|
386
246
|
name: "sqrt",
|
|
387
247
|
description: "returns the square root of the decimal.",
|
|
388
|
-
examples: [
|
|
389
|
-
"4.0.sqrt",
|
|
390
|
-
"9.0.sqrt",
|
|
391
|
-
"2.25.sqrt"
|
|
392
|
-
]
|
|
248
|
+
examples: %w[4.0.sqrt 9.0.sqrt 2.25.sqrt]
|
|
393
249
|
},
|
|
394
250
|
"truncate" => {
|
|
395
251
|
name: "truncate",
|
|
396
252
|
description: "returns the decimal truncated to a precision.",
|
|
397
|
-
examples: [
|
|
398
|
-
"1.9.truncate",
|
|
399
|
-
"1.234.truncate(2)",
|
|
400
|
-
"-1.9.truncate"
|
|
401
|
-
]
|
|
253
|
+
examples: %w[1.9.truncate 1.234.truncate(2) -1.9.truncate]
|
|
402
254
|
},
|
|
403
255
|
"to_fixed" => {
|
|
404
256
|
name: "to_fixed",
|
|
405
|
-
description:
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
"1.5.to_fixed(2)",
|
|
409
|
-
"1.234.to_fixed(1)"
|
|
410
|
-
]
|
|
257
|
+
description:
|
|
258
|
+
"returns the decimal formatted with a fixed number of fractional digits.",
|
|
259
|
+
examples: %w[1.5.to_fixed 1.5.to_fixed(2) 1.234.to_fixed(1)]
|
|
411
260
|
},
|
|
412
261
|
"to_precision" => {
|
|
413
262
|
name: "to_precision",
|
|
414
|
-
description:
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
263
|
+
description:
|
|
264
|
+
"returns the decimal formatted with a fixed number of significant digits.",
|
|
265
|
+
examples: %w[
|
|
266
|
+
1.5.to_precision
|
|
267
|
+
1.234.to_precision(2)
|
|
268
|
+
123.4.to_precision(3)
|
|
419
269
|
]
|
|
420
270
|
},
|
|
421
271
|
"to_exponential" => {
|
|
422
272
|
name: "to_exponential",
|
|
423
|
-
description:
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
273
|
+
description:
|
|
274
|
+
"returns the decimal formatted with exponential notation.",
|
|
275
|
+
examples: %w[
|
|
276
|
+
1.5.to_exponential
|
|
277
|
+
1.5.to_exponential(2)
|
|
278
|
+
123.4.to_exponential(1)
|
|
428
279
|
]
|
|
429
280
|
},
|
|
430
281
|
"week" => {
|
|
431
282
|
name: "week",
|
|
432
283
|
description: "returns a duration of this many weeks.",
|
|
433
|
-
examples: [
|
|
434
|
-
"1.5.week",
|
|
435
|
-
"2.0.week",
|
|
436
|
-
"0.5.week"
|
|
437
|
-
]
|
|
284
|
+
examples: %w[1.5.week 2.0.week 0.5.week]
|
|
438
285
|
},
|
|
439
286
|
"weeks" => {
|
|
440
287
|
name: "weeks",
|
|
441
288
|
description: "returns a duration of this many weeks.",
|
|
442
|
-
examples: [
|
|
443
|
-
"1.5.weeks",
|
|
444
|
-
"2.0.weeks",
|
|
445
|
-
"0.5.weeks"
|
|
446
|
-
]
|
|
289
|
+
examples: %w[1.5.weeks 2.0.weeks 0.5.weeks]
|
|
447
290
|
},
|
|
448
291
|
"year" => {
|
|
449
292
|
name: "year",
|
|
450
293
|
description: "returns a duration of this many years.",
|
|
451
|
-
examples: [
|
|
452
|
-
"1.5.year",
|
|
453
|
-
"2.0.year",
|
|
454
|
-
"0.5.year"
|
|
455
|
-
]
|
|
294
|
+
examples: %w[1.5.year 2.0.year 0.5.year]
|
|
456
295
|
},
|
|
457
296
|
"years" => {
|
|
458
297
|
name: "years",
|
|
459
298
|
description: "returns a duration of this many years.",
|
|
460
|
-
examples: [
|
|
461
|
-
"1.5.years",
|
|
462
|
-
"2.0.years",
|
|
463
|
-
"0.5.years"
|
|
464
|
-
]
|
|
299
|
+
examples: %w[1.5.years 2.0.years 0.5.years]
|
|
465
300
|
},
|
|
466
301
|
"|" => {
|
|
467
302
|
name: "|",
|
|
468
|
-
description:
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
"4.0 | 1",
|
|
472
|
-
"7.0 | 2"
|
|
473
|
-
]
|
|
303
|
+
description:
|
|
304
|
+
"returns the bitwise or of the decimal integer value and another number.",
|
|
305
|
+
examples: ["5.5 | 2", "4.0 | 1", "7.0 | 2"]
|
|
474
306
|
},
|
|
475
307
|
"bitwise_or" => {
|
|
476
308
|
name: "bitwise_or",
|
|
477
|
-
description:
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
"4.0.bitwise_or(1)",
|
|
481
|
-
"7.0.bitwise_or(2)"
|
|
482
|
-
]
|
|
309
|
+
description:
|
|
310
|
+
"returns the bitwise or of the decimal integer value and another number.",
|
|
311
|
+
examples: %w[5.5.bitwise_or(2) 4.0.bitwise_or(1) 7.0.bitwise_or(2)]
|
|
483
312
|
},
|
|
484
313
|
"many?" => {
|
|
485
314
|
name: "many?",
|
|
486
315
|
description: "returns whether the decimal is greater than one.",
|
|
487
|
-
examples: [
|
|
488
|
-
"2.0.many?",
|
|
489
|
-
"1.0.many?",
|
|
490
|
-
"0.5.many?"
|
|
491
|
-
]
|
|
316
|
+
examples: %w[2.0.many? 1.0.many? 0.5.many?]
|
|
492
317
|
},
|
|
493
318
|
"any?" => {
|
|
494
319
|
name: "any?",
|
|
495
320
|
description: "returns whether the decimal is positive.",
|
|
496
|
-
examples: [
|
|
497
|
-
"1.0.any?",
|
|
498
|
-
"0.0.any?",
|
|
499
|
-
"-1.0.any?"
|
|
500
|
-
]
|
|
321
|
+
examples: %w[1.0.any? 0.0.any? -1.0.any?]
|
|
501
322
|
},
|
|
502
323
|
"positive?" => {
|
|
503
324
|
name: "positive?",
|
|
504
325
|
description: "returns whether the decimal is positive.",
|
|
505
|
-
examples: [
|
|
506
|
-
"1.0.positive?",
|
|
507
|
-
"0.0.positive?",
|
|
508
|
-
"-1.0.positive?"
|
|
509
|
-
]
|
|
326
|
+
examples: %w[1.0.positive? 0.0.positive? -1.0.positive?]
|
|
510
327
|
},
|
|
511
328
|
"negative?" => {
|
|
512
329
|
name: "negative?",
|
|
513
330
|
description: "returns whether the decimal is negative.",
|
|
514
|
-
examples: [
|
|
515
|
-
"-1.0.negative?",
|
|
516
|
-
"0.0.negative?",
|
|
517
|
-
"1.0.negative?"
|
|
518
|
-
]
|
|
331
|
+
examples: %w[-1.0.negative? 0.0.negative? 1.0.negative?]
|
|
519
332
|
},
|
|
520
333
|
"next" => {
|
|
521
334
|
name: "next",
|
|
522
335
|
description: "returns the decimal plus one.",
|
|
523
|
-
examples: [
|
|
524
|
-
"1.5.next",
|
|
525
|
-
"0.0.next",
|
|
526
|
-
"-1.5.next"
|
|
527
|
-
]
|
|
336
|
+
examples: %w[1.5.next 0.0.next -1.5.next]
|
|
528
337
|
},
|
|
529
338
|
"successor" => {
|
|
530
339
|
name: "successor",
|
|
531
340
|
description: "alias for next.",
|
|
532
|
-
examples: [
|
|
533
|
-
"1.5.successor",
|
|
534
|
-
"0.0.successor",
|
|
535
|
-
"-1.5.successor"
|
|
536
|
-
]
|
|
341
|
+
examples: %w[1.5.successor 0.0.successor -1.5.successor]
|
|
537
342
|
},
|
|
538
343
|
"previous" => {
|
|
539
344
|
name: "previous",
|
|
540
345
|
description: "returns the decimal minus one.",
|
|
541
|
-
examples: [
|
|
542
|
-
"1.5.previous",
|
|
543
|
-
"0.0.previous",
|
|
544
|
-
"-1.5.previous"
|
|
545
|
-
]
|
|
346
|
+
examples: %w[1.5.previous 0.0.previous -1.5.previous]
|
|
546
347
|
},
|
|
547
348
|
"predecessor" => {
|
|
548
349
|
name: "predecessor",
|
|
549
350
|
description: "alias for previous.",
|
|
550
|
-
examples: [
|
|
551
|
-
"1.5.predecessor",
|
|
552
|
-
"0.0.predecessor",
|
|
553
|
-
"-1.5.predecessor"
|
|
554
|
-
]
|
|
351
|
+
examples: %w[1.5.predecessor 0.0.predecessor -1.5.predecessor]
|
|
555
352
|
},
|
|
556
353
|
"remainder" => {
|
|
557
354
|
name: "remainder",
|
|
558
|
-
description:
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
"10.5.remainder(3)",
|
|
562
|
-
"9.5.remainder(2)"
|
|
563
|
-
]
|
|
355
|
+
description:
|
|
356
|
+
"returns the remainder after division by another number.",
|
|
357
|
+
examples: %w[5.5.remainder(2) 10.5.remainder(3) 9.5.remainder(2)]
|
|
564
358
|
},
|
|
565
359
|
"non_zero?" => {
|
|
566
360
|
name: "non_zero?",
|
|
567
361
|
description: "returns whether the decimal is not zero.",
|
|
568
|
-
examples: [
|
|
569
|
-
"1.0.non_zero?",
|
|
570
|
-
"0.0.non_zero?",
|
|
571
|
-
"-1.0.non_zero?"
|
|
572
|
-
]
|
|
362
|
+
examples: %w[1.0.non_zero? 0.0.non_zero? -1.0.non_zero?]
|
|
573
363
|
},
|
|
574
364
|
"integer?" => {
|
|
575
365
|
name: "integer?",
|
|
576
366
|
description: "returns whether the decimal has no fractional part.",
|
|
577
|
-
examples: [
|
|
578
|
-
"1.0.integer?",
|
|
579
|
-
"1.5.integer?",
|
|
580
|
-
"0.0.integer?"
|
|
581
|
-
]
|
|
367
|
+
examples: %w[1.0.integer? 1.5.integer? 0.0.integer?]
|
|
582
368
|
},
|
|
583
369
|
"finite?" => {
|
|
584
370
|
name: "finite?",
|
|
585
371
|
description: "returns whether the decimal is finite.",
|
|
586
|
-
examples: [
|
|
587
|
-
"1.0.finite?",
|
|
588
|
-
"0.0.finite?",
|
|
589
|
-
"-1.0.finite?"
|
|
590
|
-
]
|
|
372
|
+
examples: %w[1.0.finite? 0.0.finite? -1.0.finite?]
|
|
591
373
|
},
|
|
592
374
|
"infinite?" => {
|
|
593
375
|
name: "infinite?",
|
|
594
376
|
description: "returns whether the decimal is infinite.",
|
|
595
|
-
examples: [
|
|
596
|
-
"1.0.infinite?",
|
|
597
|
-
"0.0.infinite?",
|
|
598
|
-
"-1.0.infinite?"
|
|
599
|
-
]
|
|
377
|
+
examples: %w[1.0.infinite? 0.0.infinite? -1.0.infinite?]
|
|
600
378
|
},
|
|
601
379
|
"not_a_number?" => {
|
|
602
380
|
name: "not_a_number?",
|
|
603
381
|
description: "returns whether the decimal is not a number.",
|
|
604
|
-
examples: [
|
|
605
|
-
"1.0.not_a_number?",
|
|
606
|
-
"0.0.not_a_number?",
|
|
607
|
-
"-1.0.not_a_number?"
|
|
608
|
-
]
|
|
382
|
+
examples: %w[1.0.not_a_number? 0.0.not_a_number? -1.0.not_a_number?]
|
|
609
383
|
},
|
|
610
384
|
"numerator" => {
|
|
611
385
|
name: "numerator",
|
|
612
386
|
description: "returns the decimal numerator.",
|
|
613
|
-
examples: [
|
|
614
|
-
"1.5.numerator",
|
|
615
|
-
"2.0.numerator",
|
|
616
|
-
"0.5.numerator"
|
|
617
|
-
]
|
|
387
|
+
examples: %w[1.5.numerator 2.0.numerator 0.5.numerator]
|
|
618
388
|
},
|
|
619
389
|
"denominator" => {
|
|
620
390
|
name: "denominator",
|
|
621
391
|
description: "returns the decimal denominator.",
|
|
622
|
-
examples: [
|
|
623
|
-
"1.5.denominator",
|
|
624
|
-
"2.0.denominator",
|
|
625
|
-
"0.5.denominator"
|
|
626
|
-
]
|
|
392
|
+
examples: %w[1.5.denominator 2.0.denominator 0.5.denominator]
|
|
627
393
|
},
|
|
628
394
|
"magnitude" => {
|
|
629
395
|
name: "magnitude",
|
|
630
396
|
description: "returns the absolute value of the decimal.",
|
|
631
|
-
examples: [
|
|
632
|
-
"-1.5.magnitude",
|
|
633
|
-
"1.5.magnitude",
|
|
634
|
-
"0.0.magnitude"
|
|
635
|
-
]
|
|
397
|
+
examples: %w[-1.5.magnitude 1.5.magnitude 0.0.magnitude]
|
|
636
398
|
},
|
|
637
399
|
"zero?" => {
|
|
638
400
|
name: "zero?",
|
|
639
401
|
description: "returns whether the decimal is zero.",
|
|
640
|
-
examples: [
|
|
641
|
-
"0.0.zero?",
|
|
642
|
-
"1.0.zero?",
|
|
643
|
-
"0.5.zero?"
|
|
644
|
-
]
|
|
402
|
+
examples: %w[0.0.zero? 1.0.zero? 0.5.zero?]
|
|
645
403
|
},
|
|
646
404
|
"one?" => {
|
|
647
405
|
name: "one?",
|
|
648
406
|
description: "returns whether the decimal is one.",
|
|
649
|
-
examples: [
|
|
650
|
-
"1.0.one?",
|
|
651
|
-
"2.0.one?",
|
|
652
|
-
"0.5.one?"
|
|
653
|
-
]
|
|
407
|
+
examples: %w[1.0.one? 2.0.one? 0.5.one?]
|
|
654
408
|
},
|
|
655
409
|
"two?" => {
|
|
656
410
|
name: "two?",
|
|
657
411
|
description: "returns whether the decimal is two.",
|
|
658
|
-
examples: [
|
|
659
|
-
"2.0.two?",
|
|
660
|
-
"3.0.two?",
|
|
661
|
-
"0.5.two?"
|
|
662
|
-
]
|
|
412
|
+
examples: %w[2.0.two? 3.0.two? 0.5.two?]
|
|
663
413
|
},
|
|
664
414
|
"three?" => {
|
|
665
415
|
name: "three?",
|
|
666
416
|
description: "returns whether the decimal is three.",
|
|
667
|
-
examples: [
|
|
668
|
-
"3.0.three?",
|
|
669
|
-
"4.0.three?",
|
|
670
|
-
"0.5.three?"
|
|
671
|
-
]
|
|
417
|
+
examples: %w[3.0.three? 4.0.three? 0.5.three?]
|
|
672
418
|
},
|
|
673
419
|
"four?" => {
|
|
674
420
|
name: "four?",
|
|
675
421
|
description: "returns whether the decimal is four.",
|
|
676
|
-
examples: [
|
|
677
|
-
"4.0.four?",
|
|
678
|
-
"5.0.four?",
|
|
679
|
-
"0.5.four?"
|
|
680
|
-
]
|
|
422
|
+
examples: %w[4.0.four? 5.0.four? 0.5.four?]
|
|
681
423
|
},
|
|
682
424
|
"five?" => {
|
|
683
425
|
name: "five?",
|
|
684
426
|
description: "returns whether the decimal is five.",
|
|
685
|
-
examples: [
|
|
686
|
-
"5.0.five?",
|
|
687
|
-
"6.0.five?",
|
|
688
|
-
"0.5.five?"
|
|
689
|
-
]
|
|
427
|
+
examples: %w[5.0.five? 6.0.five? 0.5.five?]
|
|
690
428
|
},
|
|
691
429
|
"six?" => {
|
|
692
430
|
name: "six?",
|
|
693
431
|
description: "returns whether the decimal is six.",
|
|
694
|
-
examples: [
|
|
695
|
-
"6.0.six?",
|
|
696
|
-
"7.0.six?",
|
|
697
|
-
"0.5.six?"
|
|
698
|
-
]
|
|
432
|
+
examples: %w[6.0.six? 7.0.six? 0.5.six?]
|
|
699
433
|
},
|
|
700
434
|
"seven?" => {
|
|
701
435
|
name: "seven?",
|
|
702
436
|
description: "returns whether the decimal is seven.",
|
|
703
|
-
examples: [
|
|
704
|
-
"7.0.seven?",
|
|
705
|
-
"8.0.seven?",
|
|
706
|
-
"0.5.seven?"
|
|
707
|
-
]
|
|
437
|
+
examples: %w[7.0.seven? 8.0.seven? 0.5.seven?]
|
|
708
438
|
},
|
|
709
439
|
"eight?" => {
|
|
710
440
|
name: "eight?",
|
|
711
441
|
description: "returns whether the decimal is eight.",
|
|
712
|
-
examples: [
|
|
713
|
-
"8.0.eight?",
|
|
714
|
-
"9.0.eight?",
|
|
715
|
-
"0.5.eight?"
|
|
716
|
-
]
|
|
442
|
+
examples: %w[8.0.eight? 9.0.eight? 0.5.eight?]
|
|
717
443
|
},
|
|
718
444
|
"nine?" => {
|
|
719
445
|
name: "nine?",
|
|
720
446
|
description: "returns whether the decimal is nine.",
|
|
721
|
-
examples: [
|
|
722
|
-
"9.0.nine?",
|
|
723
|
-
"10.0.nine?",
|
|
724
|
-
"0.5.nine?"
|
|
725
|
-
]
|
|
447
|
+
examples: %w[9.0.nine? 10.0.nine? 0.5.nine?]
|
|
726
448
|
},
|
|
727
449
|
"ten?" => {
|
|
728
450
|
name: "ten?",
|
|
729
451
|
description: "returns whether the decimal is ten.",
|
|
730
|
-
examples: [
|
|
731
|
-
"10.0.ten?",
|
|
732
|
-
"11.0.ten?",
|
|
733
|
-
"0.5.ten?"
|
|
734
|
-
]
|
|
452
|
+
examples: %w[10.0.ten? 11.0.ten? 0.5.ten?]
|
|
735
453
|
},
|
|
736
454
|
"eleven?" => {
|
|
737
455
|
name: "eleven?",
|
|
738
456
|
description: "returns whether the decimal is eleven.",
|
|
739
|
-
examples: [
|
|
740
|
-
"11.0.eleven?",
|
|
741
|
-
"12.0.eleven?",
|
|
742
|
-
"0.5.eleven?"
|
|
743
|
-
]
|
|
457
|
+
examples: %w[11.0.eleven? 12.0.eleven? 0.5.eleven?]
|
|
744
458
|
},
|
|
745
459
|
"twelve?" => {
|
|
746
460
|
name: "twelve?",
|
|
747
461
|
description: "returns whether the decimal is twelve.",
|
|
748
|
-
examples: [
|
|
749
|
-
"12.0.twelve?",
|
|
750
|
-
"13.0.twelve?",
|
|
751
|
-
"0.5.twelve?"
|
|
752
|
-
]
|
|
462
|
+
examples: %w[12.0.twelve? 13.0.twelve? 0.5.twelve?]
|
|
753
463
|
},
|
|
754
464
|
"thirteen?" => {
|
|
755
465
|
name: "thirteen?",
|
|
756
466
|
description: "returns whether the decimal is thirteen.",
|
|
757
|
-
examples: [
|
|
758
|
-
"13.0.thirteen?",
|
|
759
|
-
"14.0.thirteen?",
|
|
760
|
-
"0.5.thirteen?"
|
|
761
|
-
]
|
|
467
|
+
examples: %w[13.0.thirteen? 14.0.thirteen? 0.5.thirteen?]
|
|
762
468
|
},
|
|
763
469
|
"fourteen?" => {
|
|
764
470
|
name: "fourteen?",
|
|
765
471
|
description: "returns whether the decimal is fourteen.",
|
|
766
|
-
examples: [
|
|
767
|
-
"14.0.fourteen?",
|
|
768
|
-
"15.0.fourteen?",
|
|
769
|
-
"0.5.fourteen?"
|
|
770
|
-
]
|
|
472
|
+
examples: %w[14.0.fourteen? 15.0.fourteen? 0.5.fourteen?]
|
|
771
473
|
},
|
|
772
474
|
"fifteen?" => {
|
|
773
475
|
name: "fifteen?",
|
|
774
476
|
description: "returns whether the decimal is fifteen.",
|
|
775
|
-
examples: [
|
|
776
|
-
"15.0.fifteen?",
|
|
777
|
-
"16.0.fifteen?",
|
|
778
|
-
"0.5.fifteen?"
|
|
779
|
-
]
|
|
477
|
+
examples: %w[15.0.fifteen? 16.0.fifteen? 0.5.fifteen?]
|
|
780
478
|
},
|
|
781
479
|
"sixteen?" => {
|
|
782
480
|
name: "sixteen?",
|
|
783
481
|
description: "returns whether the decimal is sixteen.",
|
|
784
|
-
examples: [
|
|
785
|
-
"16.0.sixteen?",
|
|
786
|
-
"17.0.sixteen?",
|
|
787
|
-
"0.5.sixteen?"
|
|
788
|
-
]
|
|
482
|
+
examples: %w[16.0.sixteen? 17.0.sixteen? 0.5.sixteen?]
|
|
789
483
|
},
|
|
790
484
|
"seventeen?" => {
|
|
791
485
|
name: "seventeen?",
|
|
792
486
|
description: "returns whether the decimal is seventeen.",
|
|
793
|
-
examples: [
|
|
794
|
-
"17.0.seventeen?",
|
|
795
|
-
"18.0.seventeen?",
|
|
796
|
-
"0.5.seventeen?"
|
|
797
|
-
]
|
|
487
|
+
examples: %w[17.0.seventeen? 18.0.seventeen? 0.5.seventeen?]
|
|
798
488
|
},
|
|
799
489
|
"eighteen?" => {
|
|
800
490
|
name: "eighteen?",
|
|
801
491
|
description: "returns whether the decimal is eighteen.",
|
|
802
|
-
examples: [
|
|
803
|
-
"18.0.eighteen?",
|
|
804
|
-
"19.0.eighteen?",
|
|
805
|
-
"0.5.eighteen?"
|
|
806
|
-
]
|
|
492
|
+
examples: %w[18.0.eighteen? 19.0.eighteen? 0.5.eighteen?]
|
|
807
493
|
},
|
|
808
494
|
"nineteen?" => {
|
|
809
495
|
name: "nineteen?",
|
|
810
496
|
description: "returns whether the decimal is nineteen.",
|
|
811
|
-
examples: [
|
|
812
|
-
"19.0.nineteen?",
|
|
813
|
-
"20.0.nineteen?",
|
|
814
|
-
"0.5.nineteen?"
|
|
815
|
-
]
|
|
497
|
+
examples: %w[19.0.nineteen? 20.0.nineteen? 0.5.nineteen?]
|
|
816
498
|
},
|
|
817
499
|
"twenty?" => {
|
|
818
500
|
name: "twenty?",
|
|
819
501
|
description: "returns whether the decimal is twenty.",
|
|
820
|
-
examples: [
|
|
821
|
-
"20.0.twenty?",
|
|
822
|
-
"21.0.twenty?",
|
|
823
|
-
"0.5.twenty?"
|
|
824
|
-
]
|
|
502
|
+
examples: %w[20.0.twenty? 21.0.twenty? 0.5.twenty?]
|
|
825
503
|
},
|
|
826
504
|
"twenty_one?" => {
|
|
827
505
|
name: "twenty_one?",
|
|
828
506
|
description: "returns whether the decimal is twenty one.",
|
|
829
|
-
examples: [
|
|
830
|
-
"21.0.twenty_one?",
|
|
831
|
-
"22.0.twenty_one?",
|
|
832
|
-
"0.5.twenty_one?"
|
|
833
|
-
]
|
|
507
|
+
examples: %w[21.0.twenty_one? 22.0.twenty_one? 0.5.twenty_one?]
|
|
834
508
|
},
|
|
835
509
|
"twenty_two?" => {
|
|
836
510
|
name: "twenty_two?",
|
|
837
511
|
description: "returns whether the decimal is twenty two.",
|
|
838
|
-
examples: [
|
|
839
|
-
"22.0.twenty_two?",
|
|
840
|
-
"23.0.twenty_two?",
|
|
841
|
-
"0.5.twenty_two?"
|
|
842
|
-
]
|
|
512
|
+
examples: %w[22.0.twenty_two? 23.0.twenty_two? 0.5.twenty_two?]
|
|
843
513
|
},
|
|
844
514
|
"twenty_three?" => {
|
|
845
515
|
name: "twenty_three?",
|
|
846
516
|
description: "returns whether the decimal is twenty three.",
|
|
847
|
-
examples: [
|
|
848
|
-
"23.0.twenty_three?",
|
|
849
|
-
"24.0.twenty_three?",
|
|
850
|
-
"0.5.twenty_three?"
|
|
851
|
-
]
|
|
517
|
+
examples: %w[23.0.twenty_three? 24.0.twenty_three? 0.5.twenty_three?]
|
|
852
518
|
},
|
|
853
519
|
"twenty_four?" => {
|
|
854
520
|
name: "twenty_four?",
|
|
855
521
|
description: "returns whether the decimal is twenty four.",
|
|
856
|
-
examples: [
|
|
857
|
-
"24.0.twenty_four?",
|
|
858
|
-
"25.0.twenty_four?",
|
|
859
|
-
"0.5.twenty_four?"
|
|
860
|
-
]
|
|
522
|
+
examples: %w[24.0.twenty_four? 25.0.twenty_four? 0.5.twenty_four?]
|
|
861
523
|
},
|
|
862
524
|
"twenty_five?" => {
|
|
863
525
|
name: "twenty_five?",
|
|
864
526
|
description: "returns whether the decimal is twenty five.",
|
|
865
|
-
examples: [
|
|
866
|
-
"25.0.twenty_five?",
|
|
867
|
-
"26.0.twenty_five?",
|
|
868
|
-
"0.5.twenty_five?"
|
|
869
|
-
]
|
|
527
|
+
examples: %w[25.0.twenty_five? 26.0.twenty_five? 0.5.twenty_five?]
|
|
870
528
|
},
|
|
871
529
|
"twenty_six?" => {
|
|
872
530
|
name: "twenty_six?",
|
|
873
531
|
description: "returns whether the decimal is twenty six.",
|
|
874
|
-
examples: [
|
|
875
|
-
"26.0.twenty_six?",
|
|
876
|
-
"27.0.twenty_six?",
|
|
877
|
-
"0.5.twenty_six?"
|
|
878
|
-
]
|
|
532
|
+
examples: %w[26.0.twenty_six? 27.0.twenty_six? 0.5.twenty_six?]
|
|
879
533
|
},
|
|
880
534
|
"twenty_seven?" => {
|
|
881
535
|
name: "twenty_seven?",
|
|
882
536
|
description: "returns whether the decimal is twenty seven.",
|
|
883
|
-
examples: [
|
|
884
|
-
"27.0.twenty_seven?",
|
|
885
|
-
"28.0.twenty_seven?",
|
|
886
|
-
"0.5.twenty_seven?"
|
|
887
|
-
]
|
|
537
|
+
examples: %w[27.0.twenty_seven? 28.0.twenty_seven? 0.5.twenty_seven?]
|
|
888
538
|
},
|
|
889
539
|
"twenty_eight?" => {
|
|
890
540
|
name: "twenty_eight?",
|
|
891
541
|
description: "returns whether the decimal is twenty eight.",
|
|
892
|
-
examples: [
|
|
893
|
-
"28.0.twenty_eight?",
|
|
894
|
-
"29.0.twenty_eight?",
|
|
895
|
-
"0.5.twenty_eight?"
|
|
896
|
-
]
|
|
542
|
+
examples: %w[28.0.twenty_eight? 29.0.twenty_eight? 0.5.twenty_eight?]
|
|
897
543
|
},
|
|
898
544
|
"twenty_nine?" => {
|
|
899
545
|
name: "twenty_nine?",
|
|
900
546
|
description: "returns whether the decimal is twenty nine.",
|
|
901
|
-
examples: [
|
|
902
|
-
"29.0.twenty_nine?",
|
|
903
|
-
"30.0.twenty_nine?",
|
|
904
|
-
"0.5.twenty_nine?"
|
|
905
|
-
]
|
|
547
|
+
examples: %w[29.0.twenty_nine? 30.0.twenty_nine? 0.5.twenty_nine?]
|
|
906
548
|
},
|
|
907
549
|
"thirty?" => {
|
|
908
550
|
name: "thirty?",
|
|
909
551
|
description: "returns whether the decimal is thirty.",
|
|
910
|
-
examples: [
|
|
911
|
-
"30.0.thirty?",
|
|
912
|
-
"31.0.thirty?",
|
|
913
|
-
"0.5.thirty?"
|
|
914
|
-
]
|
|
552
|
+
examples: %w[30.0.thirty? 31.0.thirty? 0.5.thirty?]
|
|
915
553
|
},
|
|
916
554
|
"thirty_one?" => {
|
|
917
555
|
name: "thirty_one?",
|
|
918
556
|
description: "returns whether the decimal is thirty one.",
|
|
919
|
-
examples: [
|
|
920
|
-
"31.0.thirty_one?",
|
|
921
|
-
"32.0.thirty_one?",
|
|
922
|
-
"0.5.thirty_one?"
|
|
923
|
-
]
|
|
557
|
+
examples: %w[31.0.thirty_one? 32.0.thirty_one? 0.5.thirty_one?]
|
|
924
558
|
},
|
|
925
559
|
"thirty_two?" => {
|
|
926
560
|
name: "thirty_two?",
|
|
927
561
|
description: "returns whether the decimal is thirty two.",
|
|
928
|
-
examples: [
|
|
929
|
-
"32.0.thirty_two?",
|
|
930
|
-
"33.0.thirty_two?",
|
|
931
|
-
"0.5.thirty_two?"
|
|
932
|
-
]
|
|
562
|
+
examples: %w[32.0.thirty_two? 33.0.thirty_two? 0.5.thirty_two?]
|
|
933
563
|
},
|
|
934
564
|
"thirty_three?" => {
|
|
935
565
|
name: "thirty_three?",
|
|
936
566
|
description: "returns whether the decimal is thirty three.",
|
|
937
|
-
examples: [
|
|
938
|
-
"33.0.thirty_three?",
|
|
939
|
-
"34.0.thirty_three?",
|
|
940
|
-
"0.5.thirty_three?"
|
|
941
|
-
]
|
|
567
|
+
examples: %w[33.0.thirty_three? 34.0.thirty_three? 0.5.thirty_three?]
|
|
942
568
|
},
|
|
943
569
|
"thirty_four?" => {
|
|
944
570
|
name: "thirty_four?",
|
|
945
571
|
description: "returns whether the decimal is thirty four.",
|
|
946
|
-
examples: [
|
|
947
|
-
"34.0.thirty_four?",
|
|
948
|
-
"35.0.thirty_four?",
|
|
949
|
-
"0.5.thirty_four?"
|
|
950
|
-
]
|
|
572
|
+
examples: %w[34.0.thirty_four? 35.0.thirty_four? 0.5.thirty_four?]
|
|
951
573
|
},
|
|
952
574
|
"thirty_five?" => {
|
|
953
575
|
name: "thirty_five?",
|
|
954
576
|
description: "returns whether the decimal is thirty five.",
|
|
955
|
-
examples: [
|
|
956
|
-
"35.0.thirty_five?",
|
|
957
|
-
"36.0.thirty_five?",
|
|
958
|
-
"0.5.thirty_five?"
|
|
959
|
-
]
|
|
577
|
+
examples: %w[35.0.thirty_five? 36.0.thirty_five? 0.5.thirty_five?]
|
|
960
578
|
},
|
|
961
579
|
"thirty_six?" => {
|
|
962
580
|
name: "thirty_six?",
|
|
963
581
|
description: "returns whether the decimal is thirty six.",
|
|
964
|
-
examples: [
|
|
965
|
-
"36.0.thirty_six?",
|
|
966
|
-
"37.0.thirty_six?",
|
|
967
|
-
"0.5.thirty_six?"
|
|
968
|
-
]
|
|
582
|
+
examples: %w[36.0.thirty_six? 37.0.thirty_six? 0.5.thirty_six?]
|
|
969
583
|
},
|
|
970
584
|
"thirty_seven?" => {
|
|
971
585
|
name: "thirty_seven?",
|
|
972
586
|
description: "returns whether the decimal is thirty seven.",
|
|
973
|
-
examples: [
|
|
974
|
-
"37.0.thirty_seven?",
|
|
975
|
-
"38.0.thirty_seven?",
|
|
976
|
-
"0.5.thirty_seven?"
|
|
977
|
-
]
|
|
587
|
+
examples: %w[37.0.thirty_seven? 38.0.thirty_seven? 0.5.thirty_seven?]
|
|
978
588
|
},
|
|
979
589
|
"thirty_eight?" => {
|
|
980
590
|
name: "thirty_eight?",
|
|
981
591
|
description: "returns whether the decimal is thirty eight.",
|
|
982
|
-
examples: [
|
|
983
|
-
"38.0.thirty_eight?",
|
|
984
|
-
"39.0.thirty_eight?",
|
|
985
|
-
"0.5.thirty_eight?"
|
|
986
|
-
]
|
|
592
|
+
examples: %w[38.0.thirty_eight? 39.0.thirty_eight? 0.5.thirty_eight?]
|
|
987
593
|
},
|
|
988
594
|
"thirty_nine?" => {
|
|
989
595
|
name: "thirty_nine?",
|
|
990
596
|
description: "returns whether the decimal is thirty nine.",
|
|
991
|
-
examples: [
|
|
992
|
-
"39.0.thirty_nine?",
|
|
993
|
-
"40.0.thirty_nine?",
|
|
994
|
-
"0.5.thirty_nine?"
|
|
995
|
-
]
|
|
597
|
+
examples: %w[39.0.thirty_nine? 40.0.thirty_nine? 0.5.thirty_nine?]
|
|
996
598
|
},
|
|
997
599
|
"forty?" => {
|
|
998
600
|
name: "forty?",
|
|
999
601
|
description: "returns whether the decimal is forty.",
|
|
1000
|
-
examples: [
|
|
1001
|
-
"40.0.forty?",
|
|
1002
|
-
"41.0.forty?",
|
|
1003
|
-
"0.5.forty?"
|
|
1004
|
-
]
|
|
602
|
+
examples: %w[40.0.forty? 41.0.forty? 0.5.forty?]
|
|
1005
603
|
},
|
|
1006
604
|
"forty_one?" => {
|
|
1007
605
|
name: "forty_one?",
|
|
1008
606
|
description: "returns whether the decimal is forty one.",
|
|
1009
|
-
examples: [
|
|
1010
|
-
"41.0.forty_one?",
|
|
1011
|
-
"42.0.forty_one?",
|
|
1012
|
-
"0.5.forty_one?"
|
|
1013
|
-
]
|
|
607
|
+
examples: %w[41.0.forty_one? 42.0.forty_one? 0.5.forty_one?]
|
|
1014
608
|
},
|
|
1015
609
|
"forty_two?" => {
|
|
1016
610
|
name: "forty_two?",
|
|
1017
611
|
description: "returns whether the decimal is forty two.",
|
|
1018
|
-
examples: [
|
|
1019
|
-
"42.0.forty_two?",
|
|
1020
|
-
"43.0.forty_two?",
|
|
1021
|
-
"0.5.forty_two?"
|
|
1022
|
-
]
|
|
612
|
+
examples: %w[42.0.forty_two? 43.0.forty_two? 0.5.forty_two?]
|
|
1023
613
|
},
|
|
1024
614
|
"forty_three?" => {
|
|
1025
615
|
name: "forty_three?",
|
|
1026
616
|
description: "returns whether the decimal is forty three.",
|
|
1027
|
-
examples: [
|
|
1028
|
-
"43.0.forty_three?",
|
|
1029
|
-
"44.0.forty_three?",
|
|
1030
|
-
"0.5.forty_three?"
|
|
1031
|
-
]
|
|
617
|
+
examples: %w[43.0.forty_three? 44.0.forty_three? 0.5.forty_three?]
|
|
1032
618
|
},
|
|
1033
619
|
"forty_four?" => {
|
|
1034
620
|
name: "forty_four?",
|
|
1035
621
|
description: "returns whether the decimal is forty four.",
|
|
1036
|
-
examples: [
|
|
1037
|
-
"44.0.forty_four?",
|
|
1038
|
-
"45.0.forty_four?",
|
|
1039
|
-
"0.5.forty_four?"
|
|
1040
|
-
]
|
|
622
|
+
examples: %w[44.0.forty_four? 45.0.forty_four? 0.5.forty_four?]
|
|
1041
623
|
},
|
|
1042
624
|
"forty_five?" => {
|
|
1043
625
|
name: "forty_five?",
|
|
1044
626
|
description: "returns whether the decimal is forty five.",
|
|
1045
|
-
examples: [
|
|
1046
|
-
"45.0.forty_five?",
|
|
1047
|
-
"46.0.forty_five?",
|
|
1048
|
-
"0.5.forty_five?"
|
|
1049
|
-
]
|
|
627
|
+
examples: %w[45.0.forty_five? 46.0.forty_five? 0.5.forty_five?]
|
|
1050
628
|
},
|
|
1051
629
|
"forty_six?" => {
|
|
1052
630
|
name: "forty_six?",
|
|
1053
631
|
description: "returns whether the decimal is forty six.",
|
|
1054
|
-
examples: [
|
|
1055
|
-
"46.0.forty_six?",
|
|
1056
|
-
"47.0.forty_six?",
|
|
1057
|
-
"0.5.forty_six?"
|
|
1058
|
-
]
|
|
632
|
+
examples: %w[46.0.forty_six? 47.0.forty_six? 0.5.forty_six?]
|
|
1059
633
|
},
|
|
1060
634
|
"forty_seven?" => {
|
|
1061
635
|
name: "forty_seven?",
|
|
1062
636
|
description: "returns whether the decimal is forty seven.",
|
|
1063
|
-
examples: [
|
|
1064
|
-
"47.0.forty_seven?",
|
|
1065
|
-
"48.0.forty_seven?",
|
|
1066
|
-
"0.5.forty_seven?"
|
|
1067
|
-
]
|
|
637
|
+
examples: %w[47.0.forty_seven? 48.0.forty_seven? 0.5.forty_seven?]
|
|
1068
638
|
},
|
|
1069
639
|
"forty_eight?" => {
|
|
1070
640
|
name: "forty_eight?",
|
|
1071
641
|
description: "returns whether the decimal is forty eight.",
|
|
1072
|
-
examples: [
|
|
1073
|
-
"48.0.forty_eight?",
|
|
1074
|
-
"49.0.forty_eight?",
|
|
1075
|
-
"0.5.forty_eight?"
|
|
1076
|
-
]
|
|
642
|
+
examples: %w[48.0.forty_eight? 49.0.forty_eight? 0.5.forty_eight?]
|
|
1077
643
|
},
|
|
1078
644
|
"forty_nine?" => {
|
|
1079
645
|
name: "forty_nine?",
|
|
1080
646
|
description: "returns whether the decimal is forty nine.",
|
|
1081
|
-
examples: [
|
|
1082
|
-
"49.0.forty_nine?",
|
|
1083
|
-
"50.0.forty_nine?",
|
|
1084
|
-
"0.5.forty_nine?"
|
|
1085
|
-
]
|
|
647
|
+
examples: %w[49.0.forty_nine? 50.0.forty_nine? 0.5.forty_nine?]
|
|
1086
648
|
},
|
|
1087
649
|
"fifty?" => {
|
|
1088
650
|
name: "fifty?",
|
|
1089
651
|
description: "returns whether the decimal is fifty.",
|
|
1090
|
-
examples: [
|
|
1091
|
-
"50.0.fifty?",
|
|
1092
|
-
"51.0.fifty?",
|
|
1093
|
-
"0.5.fifty?"
|
|
1094
|
-
]
|
|
652
|
+
examples: %w[50.0.fifty? 51.0.fifty? 0.5.fifty?]
|
|
1095
653
|
},
|
|
1096
654
|
"fifty_one?" => {
|
|
1097
655
|
name: "fifty_one?",
|
|
1098
656
|
description: "returns whether the decimal is fifty one.",
|
|
1099
|
-
examples: [
|
|
1100
|
-
"51.0.fifty_one?",
|
|
1101
|
-
"52.0.fifty_one?",
|
|
1102
|
-
"0.5.fifty_one?"
|
|
1103
|
-
]
|
|
657
|
+
examples: %w[51.0.fifty_one? 52.0.fifty_one? 0.5.fifty_one?]
|
|
1104
658
|
},
|
|
1105
659
|
"fifty_two?" => {
|
|
1106
660
|
name: "fifty_two?",
|
|
1107
661
|
description: "returns whether the decimal is fifty two.",
|
|
1108
|
-
examples: [
|
|
1109
|
-
"52.0.fifty_two?",
|
|
1110
|
-
"53.0.fifty_two?",
|
|
1111
|
-
"0.5.fifty_two?"
|
|
1112
|
-
]
|
|
662
|
+
examples: %w[52.0.fifty_two? 53.0.fifty_two? 0.5.fifty_two?]
|
|
1113
663
|
},
|
|
1114
664
|
"fifty_three?" => {
|
|
1115
665
|
name: "fifty_three?",
|
|
1116
666
|
description: "returns whether the decimal is fifty three.",
|
|
1117
|
-
examples: [
|
|
1118
|
-
"53.0.fifty_three?",
|
|
1119
|
-
"54.0.fifty_three?",
|
|
1120
|
-
"0.5.fifty_three?"
|
|
1121
|
-
]
|
|
667
|
+
examples: %w[53.0.fifty_three? 54.0.fifty_three? 0.5.fifty_three?]
|
|
1122
668
|
},
|
|
1123
669
|
"fifty_four?" => {
|
|
1124
670
|
name: "fifty_four?",
|
|
1125
671
|
description: "returns whether the decimal is fifty four.",
|
|
1126
|
-
examples: [
|
|
1127
|
-
"54.0.fifty_four?",
|
|
1128
|
-
"55.0.fifty_four?",
|
|
1129
|
-
"0.5.fifty_four?"
|
|
1130
|
-
]
|
|
672
|
+
examples: %w[54.0.fifty_four? 55.0.fifty_four? 0.5.fifty_four?]
|
|
1131
673
|
},
|
|
1132
674
|
"fifty_five?" => {
|
|
1133
675
|
name: "fifty_five?",
|
|
1134
676
|
description: "returns whether the decimal is fifty five.",
|
|
1135
|
-
examples: [
|
|
1136
|
-
"55.0.fifty_five?",
|
|
1137
|
-
"56.0.fifty_five?",
|
|
1138
|
-
"0.5.fifty_five?"
|
|
1139
|
-
]
|
|
677
|
+
examples: %w[55.0.fifty_five? 56.0.fifty_five? 0.5.fifty_five?]
|
|
1140
678
|
},
|
|
1141
679
|
"fifty_six?" => {
|
|
1142
680
|
name: "fifty_six?",
|
|
1143
681
|
description: "returns whether the decimal is fifty six.",
|
|
1144
|
-
examples: [
|
|
1145
|
-
"56.0.fifty_six?",
|
|
1146
|
-
"57.0.fifty_six?",
|
|
1147
|
-
"0.5.fifty_six?"
|
|
1148
|
-
]
|
|
682
|
+
examples: %w[56.0.fifty_six? 57.0.fifty_six? 0.5.fifty_six?]
|
|
1149
683
|
},
|
|
1150
684
|
"fifty_seven?" => {
|
|
1151
685
|
name: "fifty_seven?",
|
|
1152
686
|
description: "returns whether the decimal is fifty seven.",
|
|
1153
|
-
examples: [
|
|
1154
|
-
"57.0.fifty_seven?",
|
|
1155
|
-
"58.0.fifty_seven?",
|
|
1156
|
-
"0.5.fifty_seven?"
|
|
1157
|
-
]
|
|
687
|
+
examples: %w[57.0.fifty_seven? 58.0.fifty_seven? 0.5.fifty_seven?]
|
|
1158
688
|
},
|
|
1159
689
|
"fifty_eight?" => {
|
|
1160
690
|
name: "fifty_eight?",
|
|
1161
691
|
description: "returns whether the decimal is fifty eight.",
|
|
1162
|
-
examples: [
|
|
1163
|
-
"58.0.fifty_eight?",
|
|
1164
|
-
"59.0.fifty_eight?",
|
|
1165
|
-
"0.5.fifty_eight?"
|
|
1166
|
-
]
|
|
692
|
+
examples: %w[58.0.fifty_eight? 59.0.fifty_eight? 0.5.fifty_eight?]
|
|
1167
693
|
},
|
|
1168
694
|
"fifty_nine?" => {
|
|
1169
695
|
name: "fifty_nine?",
|
|
1170
696
|
description: "returns whether the decimal is fifty nine.",
|
|
1171
|
-
examples: [
|
|
1172
|
-
"59.0.fifty_nine?",
|
|
1173
|
-
"60.0.fifty_nine?",
|
|
1174
|
-
"0.5.fifty_nine?"
|
|
1175
|
-
]
|
|
697
|
+
examples: %w[59.0.fifty_nine? 60.0.fifty_nine? 0.5.fifty_nine?]
|
|
1176
698
|
},
|
|
1177
699
|
"sixty?" => {
|
|
1178
700
|
name: "sixty?",
|
|
1179
701
|
description: "returns whether the decimal is sixty.",
|
|
1180
|
-
examples: [
|
|
1181
|
-
"60.0.sixty?",
|
|
1182
|
-
"61.0.sixty?",
|
|
1183
|
-
"0.5.sixty?"
|
|
1184
|
-
]
|
|
702
|
+
examples: %w[60.0.sixty? 61.0.sixty? 0.5.sixty?]
|
|
1185
703
|
},
|
|
1186
704
|
"sixty_one?" => {
|
|
1187
705
|
name: "sixty_one?",
|
|
1188
706
|
description: "returns whether the decimal is sixty one.",
|
|
1189
|
-
examples: [
|
|
1190
|
-
"61.0.sixty_one?",
|
|
1191
|
-
"62.0.sixty_one?",
|
|
1192
|
-
"0.5.sixty_one?"
|
|
1193
|
-
]
|
|
707
|
+
examples: %w[61.0.sixty_one? 62.0.sixty_one? 0.5.sixty_one?]
|
|
1194
708
|
},
|
|
1195
709
|
"sixty_two?" => {
|
|
1196
710
|
name: "sixty_two?",
|
|
1197
711
|
description: "returns whether the decimal is sixty two.",
|
|
1198
|
-
examples: [
|
|
1199
|
-
"62.0.sixty_two?",
|
|
1200
|
-
"63.0.sixty_two?",
|
|
1201
|
-
"0.5.sixty_two?"
|
|
1202
|
-
]
|
|
712
|
+
examples: %w[62.0.sixty_two? 63.0.sixty_two? 0.5.sixty_two?]
|
|
1203
713
|
},
|
|
1204
714
|
"sixty_three?" => {
|
|
1205
715
|
name: "sixty_three?",
|
|
1206
716
|
description: "returns whether the decimal is sixty three.",
|
|
1207
|
-
examples: [
|
|
1208
|
-
"63.0.sixty_three?",
|
|
1209
|
-
"64.0.sixty_three?",
|
|
1210
|
-
"0.5.sixty_three?"
|
|
1211
|
-
]
|
|
717
|
+
examples: %w[63.0.sixty_three? 64.0.sixty_three? 0.5.sixty_three?]
|
|
1212
718
|
},
|
|
1213
719
|
"sixty_four?" => {
|
|
1214
720
|
name: "sixty_four?",
|
|
1215
721
|
description: "returns whether the decimal is sixty four.",
|
|
1216
|
-
examples: [
|
|
1217
|
-
"64.0.sixty_four?",
|
|
1218
|
-
"65.0.sixty_four?",
|
|
1219
|
-
"0.5.sixty_four?"
|
|
1220
|
-
]
|
|
722
|
+
examples: %w[64.0.sixty_four? 65.0.sixty_four? 0.5.sixty_four?]
|
|
1221
723
|
},
|
|
1222
724
|
"sixty_five?" => {
|
|
1223
725
|
name: "sixty_five?",
|
|
1224
726
|
description: "returns whether the decimal is sixty five.",
|
|
1225
|
-
examples: [
|
|
1226
|
-
"65.0.sixty_five?",
|
|
1227
|
-
"66.0.sixty_five?",
|
|
1228
|
-
"0.5.sixty_five?"
|
|
1229
|
-
]
|
|
727
|
+
examples: %w[65.0.sixty_five? 66.0.sixty_five? 0.5.sixty_five?]
|
|
1230
728
|
},
|
|
1231
729
|
"sixty_six?" => {
|
|
1232
730
|
name: "sixty_six?",
|
|
1233
731
|
description: "returns whether the decimal is sixty six.",
|
|
1234
|
-
examples: [
|
|
1235
|
-
"66.0.sixty_six?",
|
|
1236
|
-
"67.0.sixty_six?",
|
|
1237
|
-
"0.5.sixty_six?"
|
|
1238
|
-
]
|
|
732
|
+
examples: %w[66.0.sixty_six? 67.0.sixty_six? 0.5.sixty_six?]
|
|
1239
733
|
},
|
|
1240
734
|
"sixty_seven?" => {
|
|
1241
735
|
name: "sixty_seven?",
|
|
1242
736
|
description: "returns whether the decimal is sixty seven.",
|
|
1243
|
-
examples: [
|
|
1244
|
-
"67.0.sixty_seven?",
|
|
1245
|
-
"68.0.sixty_seven?",
|
|
1246
|
-
"0.5.sixty_seven?"
|
|
1247
|
-
]
|
|
737
|
+
examples: %w[67.0.sixty_seven? 68.0.sixty_seven? 0.5.sixty_seven?]
|
|
1248
738
|
},
|
|
1249
739
|
"sixty_eight?" => {
|
|
1250
740
|
name: "sixty_eight?",
|
|
1251
741
|
description: "returns whether the decimal is sixty eight.",
|
|
1252
|
-
examples: [
|
|
1253
|
-
"68.0.sixty_eight?",
|
|
1254
|
-
"69.0.sixty_eight?",
|
|
1255
|
-
"0.5.sixty_eight?"
|
|
1256
|
-
]
|
|
742
|
+
examples: %w[68.0.sixty_eight? 69.0.sixty_eight? 0.5.sixty_eight?]
|
|
1257
743
|
},
|
|
1258
744
|
"sixty_nine?" => {
|
|
1259
745
|
name: "sixty_nine?",
|
|
1260
746
|
description: "returns whether the decimal is sixty nine.",
|
|
1261
|
-
examples: [
|
|
1262
|
-
"69.0.sixty_nine?",
|
|
1263
|
-
"70.0.sixty_nine?",
|
|
1264
|
-
"0.5.sixty_nine?"
|
|
1265
|
-
]
|
|
747
|
+
examples: %w[69.0.sixty_nine? 70.0.sixty_nine? 0.5.sixty_nine?]
|
|
1266
748
|
},
|
|
1267
749
|
"seventy?" => {
|
|
1268
750
|
name: "seventy?",
|
|
1269
751
|
description: "returns whether the decimal is seventy.",
|
|
1270
|
-
examples: [
|
|
1271
|
-
"70.0.seventy?",
|
|
1272
|
-
"71.0.seventy?",
|
|
1273
|
-
"0.5.seventy?"
|
|
1274
|
-
]
|
|
752
|
+
examples: %w[70.0.seventy? 71.0.seventy? 0.5.seventy?]
|
|
1275
753
|
},
|
|
1276
754
|
"seventy_one?" => {
|
|
1277
755
|
name: "seventy_one?",
|
|
1278
756
|
description: "returns whether the decimal is seventy one.",
|
|
1279
|
-
examples: [
|
|
1280
|
-
"71.0.seventy_one?",
|
|
1281
|
-
"72.0.seventy_one?",
|
|
1282
|
-
"0.5.seventy_one?"
|
|
1283
|
-
]
|
|
757
|
+
examples: %w[71.0.seventy_one? 72.0.seventy_one? 0.5.seventy_one?]
|
|
1284
758
|
},
|
|
1285
759
|
"seventy_two?" => {
|
|
1286
760
|
name: "seventy_two?",
|
|
1287
761
|
description: "returns whether the decimal is seventy two.",
|
|
1288
|
-
examples: [
|
|
1289
|
-
"72.0.seventy_two?",
|
|
1290
|
-
"73.0.seventy_two?",
|
|
1291
|
-
"0.5.seventy_two?"
|
|
1292
|
-
]
|
|
762
|
+
examples: %w[72.0.seventy_two? 73.0.seventy_two? 0.5.seventy_two?]
|
|
1293
763
|
},
|
|
1294
764
|
"seventy_three?" => {
|
|
1295
765
|
name: "seventy_three?",
|
|
1296
766
|
description: "returns whether the decimal is seventy three.",
|
|
1297
|
-
examples: [
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
767
|
+
examples: %w[
|
|
768
|
+
73.0.seventy_three?
|
|
769
|
+
74.0.seventy_three?
|
|
770
|
+
0.5.seventy_three?
|
|
1301
771
|
]
|
|
1302
772
|
},
|
|
1303
773
|
"seventy_four?" => {
|
|
1304
774
|
name: "seventy_four?",
|
|
1305
775
|
description: "returns whether the decimal is seventy four.",
|
|
1306
|
-
examples: [
|
|
1307
|
-
"74.0.seventy_four?",
|
|
1308
|
-
"75.0.seventy_four?",
|
|
1309
|
-
"0.5.seventy_four?"
|
|
1310
|
-
]
|
|
776
|
+
examples: %w[74.0.seventy_four? 75.0.seventy_four? 0.5.seventy_four?]
|
|
1311
777
|
},
|
|
1312
778
|
"seventy_five?" => {
|
|
1313
779
|
name: "seventy_five?",
|
|
1314
780
|
description: "returns whether the decimal is seventy five.",
|
|
1315
|
-
examples: [
|
|
1316
|
-
"75.0.seventy_five?",
|
|
1317
|
-
"76.0.seventy_five?",
|
|
1318
|
-
"0.5.seventy_five?"
|
|
1319
|
-
]
|
|
781
|
+
examples: %w[75.0.seventy_five? 76.0.seventy_five? 0.5.seventy_five?]
|
|
1320
782
|
},
|
|
1321
783
|
"seventy_six?" => {
|
|
1322
784
|
name: "seventy_six?",
|
|
1323
785
|
description: "returns whether the decimal is seventy six.",
|
|
1324
|
-
examples: [
|
|
1325
|
-
"76.0.seventy_six?",
|
|
1326
|
-
"77.0.seventy_six?",
|
|
1327
|
-
"0.5.seventy_six?"
|
|
1328
|
-
]
|
|
786
|
+
examples: %w[76.0.seventy_six? 77.0.seventy_six? 0.5.seventy_six?]
|
|
1329
787
|
},
|
|
1330
788
|
"seventy_seven?" => {
|
|
1331
789
|
name: "seventy_seven?",
|
|
1332
790
|
description: "returns whether the decimal is seventy seven.",
|
|
1333
|
-
examples: [
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
791
|
+
examples: %w[
|
|
792
|
+
77.0.seventy_seven?
|
|
793
|
+
78.0.seventy_seven?
|
|
794
|
+
0.5.seventy_seven?
|
|
1337
795
|
]
|
|
1338
796
|
},
|
|
1339
797
|
"seventy_eight?" => {
|
|
1340
798
|
name: "seventy_eight?",
|
|
1341
799
|
description: "returns whether the decimal is seventy eight.",
|
|
1342
|
-
examples: [
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
800
|
+
examples: %w[
|
|
801
|
+
78.0.seventy_eight?
|
|
802
|
+
79.0.seventy_eight?
|
|
803
|
+
0.5.seventy_eight?
|
|
1346
804
|
]
|
|
1347
805
|
},
|
|
1348
806
|
"seventy_nine?" => {
|
|
1349
807
|
name: "seventy_nine?",
|
|
1350
808
|
description: "returns whether the decimal is seventy nine.",
|
|
1351
|
-
examples: [
|
|
1352
|
-
"79.0.seventy_nine?",
|
|
1353
|
-
"80.0.seventy_nine?",
|
|
1354
|
-
"0.5.seventy_nine?"
|
|
1355
|
-
]
|
|
809
|
+
examples: %w[79.0.seventy_nine? 80.0.seventy_nine? 0.5.seventy_nine?]
|
|
1356
810
|
},
|
|
1357
811
|
"eighty?" => {
|
|
1358
812
|
name: "eighty?",
|
|
1359
813
|
description: "returns whether the decimal is eighty.",
|
|
1360
|
-
examples: [
|
|
1361
|
-
"80.0.eighty?",
|
|
1362
|
-
"81.0.eighty?",
|
|
1363
|
-
"0.5.eighty?"
|
|
1364
|
-
]
|
|
814
|
+
examples: %w[80.0.eighty? 81.0.eighty? 0.5.eighty?]
|
|
1365
815
|
},
|
|
1366
816
|
"eighty_one?" => {
|
|
1367
817
|
name: "eighty_one?",
|
|
1368
818
|
description: "returns whether the decimal is eighty one.",
|
|
1369
|
-
examples: [
|
|
1370
|
-
"81.0.eighty_one?",
|
|
1371
|
-
"82.0.eighty_one?",
|
|
1372
|
-
"0.5.eighty_one?"
|
|
1373
|
-
]
|
|
819
|
+
examples: %w[81.0.eighty_one? 82.0.eighty_one? 0.5.eighty_one?]
|
|
1374
820
|
},
|
|
1375
821
|
"eighty_two?" => {
|
|
1376
822
|
name: "eighty_two?",
|
|
1377
823
|
description: "returns whether the decimal is eighty two.",
|
|
1378
|
-
examples: [
|
|
1379
|
-
"82.0.eighty_two?",
|
|
1380
|
-
"83.0.eighty_two?",
|
|
1381
|
-
"0.5.eighty_two?"
|
|
1382
|
-
]
|
|
824
|
+
examples: %w[82.0.eighty_two? 83.0.eighty_two? 0.5.eighty_two?]
|
|
1383
825
|
},
|
|
1384
826
|
"eighty_three?" => {
|
|
1385
827
|
name: "eighty_three?",
|
|
1386
828
|
description: "returns whether the decimal is eighty three.",
|
|
1387
|
-
examples: [
|
|
1388
|
-
"83.0.eighty_three?",
|
|
1389
|
-
"84.0.eighty_three?",
|
|
1390
|
-
"0.5.eighty_three?"
|
|
1391
|
-
]
|
|
829
|
+
examples: %w[83.0.eighty_three? 84.0.eighty_three? 0.5.eighty_three?]
|
|
1392
830
|
},
|
|
1393
831
|
"eighty_four?" => {
|
|
1394
832
|
name: "eighty_four?",
|
|
1395
833
|
description: "returns whether the decimal is eighty four.",
|
|
1396
|
-
examples: [
|
|
1397
|
-
"84.0.eighty_four?",
|
|
1398
|
-
"85.0.eighty_four?",
|
|
1399
|
-
"0.5.eighty_four?"
|
|
1400
|
-
]
|
|
834
|
+
examples: %w[84.0.eighty_four? 85.0.eighty_four? 0.5.eighty_four?]
|
|
1401
835
|
},
|
|
1402
836
|
"eighty_five?" => {
|
|
1403
837
|
name: "eighty_five?",
|
|
1404
838
|
description: "returns whether the decimal is eighty five.",
|
|
1405
|
-
examples: [
|
|
1406
|
-
"85.0.eighty_five?",
|
|
1407
|
-
"86.0.eighty_five?",
|
|
1408
|
-
"0.5.eighty_five?"
|
|
1409
|
-
]
|
|
839
|
+
examples: %w[85.0.eighty_five? 86.0.eighty_five? 0.5.eighty_five?]
|
|
1410
840
|
},
|
|
1411
841
|
"eighty_six?" => {
|
|
1412
842
|
name: "eighty_six?",
|
|
1413
843
|
description: "returns whether the decimal is eighty six.",
|
|
1414
|
-
examples: [
|
|
1415
|
-
"86.0.eighty_six?",
|
|
1416
|
-
"87.0.eighty_six?",
|
|
1417
|
-
"0.5.eighty_six?"
|
|
1418
|
-
]
|
|
844
|
+
examples: %w[86.0.eighty_six? 87.0.eighty_six? 0.5.eighty_six?]
|
|
1419
845
|
},
|
|
1420
846
|
"eighty_seven?" => {
|
|
1421
847
|
name: "eighty_seven?",
|
|
1422
848
|
description: "returns whether the decimal is eighty seven.",
|
|
1423
|
-
examples: [
|
|
1424
|
-
"87.0.eighty_seven?",
|
|
1425
|
-
"88.0.eighty_seven?",
|
|
1426
|
-
"0.5.eighty_seven?"
|
|
1427
|
-
]
|
|
849
|
+
examples: %w[87.0.eighty_seven? 88.0.eighty_seven? 0.5.eighty_seven?]
|
|
1428
850
|
},
|
|
1429
851
|
"eighty_eight?" => {
|
|
1430
852
|
name: "eighty_eight?",
|
|
1431
853
|
description: "returns whether the decimal is eighty eight.",
|
|
1432
|
-
examples: [
|
|
1433
|
-
"88.0.eighty_eight?",
|
|
1434
|
-
"89.0.eighty_eight?",
|
|
1435
|
-
"0.5.eighty_eight?"
|
|
1436
|
-
]
|
|
854
|
+
examples: %w[88.0.eighty_eight? 89.0.eighty_eight? 0.5.eighty_eight?]
|
|
1437
855
|
},
|
|
1438
856
|
"eighty_nine?" => {
|
|
1439
857
|
name: "eighty_nine?",
|
|
1440
858
|
description: "returns whether the decimal is eighty nine.",
|
|
1441
|
-
examples: [
|
|
1442
|
-
"89.0.eighty_nine?",
|
|
1443
|
-
"90.0.eighty_nine?",
|
|
1444
|
-
"0.5.eighty_nine?"
|
|
1445
|
-
]
|
|
859
|
+
examples: %w[89.0.eighty_nine? 90.0.eighty_nine? 0.5.eighty_nine?]
|
|
1446
860
|
},
|
|
1447
861
|
"ninety?" => {
|
|
1448
862
|
name: "ninety?",
|
|
1449
863
|
description: "returns whether the decimal is ninety.",
|
|
1450
|
-
examples: [
|
|
1451
|
-
"90.0.ninety?",
|
|
1452
|
-
"91.0.ninety?",
|
|
1453
|
-
"0.5.ninety?"
|
|
1454
|
-
]
|
|
864
|
+
examples: %w[90.0.ninety? 91.0.ninety? 0.5.ninety?]
|
|
1455
865
|
},
|
|
1456
866
|
"ninety_one?" => {
|
|
1457
867
|
name: "ninety_one?",
|
|
1458
868
|
description: "returns whether the decimal is ninety one.",
|
|
1459
|
-
examples: [
|
|
1460
|
-
"91.0.ninety_one?",
|
|
1461
|
-
"92.0.ninety_one?",
|
|
1462
|
-
"0.5.ninety_one?"
|
|
1463
|
-
]
|
|
869
|
+
examples: %w[91.0.ninety_one? 92.0.ninety_one? 0.5.ninety_one?]
|
|
1464
870
|
},
|
|
1465
871
|
"ninety_two?" => {
|
|
1466
872
|
name: "ninety_two?",
|
|
1467
873
|
description: "returns whether the decimal is ninety two.",
|
|
1468
|
-
examples: [
|
|
1469
|
-
"92.0.ninety_two?",
|
|
1470
|
-
"93.0.ninety_two?",
|
|
1471
|
-
"0.5.ninety_two?"
|
|
1472
|
-
]
|
|
874
|
+
examples: %w[92.0.ninety_two? 93.0.ninety_two? 0.5.ninety_two?]
|
|
1473
875
|
},
|
|
1474
876
|
"ninety_three?" => {
|
|
1475
877
|
name: "ninety_three?",
|
|
1476
878
|
description: "returns whether the decimal is ninety three.",
|
|
1477
|
-
examples: [
|
|
1478
|
-
"93.0.ninety_three?",
|
|
1479
|
-
"94.0.ninety_three?",
|
|
1480
|
-
"0.5.ninety_three?"
|
|
1481
|
-
]
|
|
879
|
+
examples: %w[93.0.ninety_three? 94.0.ninety_three? 0.5.ninety_three?]
|
|
1482
880
|
},
|
|
1483
881
|
"ninety_four?" => {
|
|
1484
882
|
name: "ninety_four?",
|
|
1485
883
|
description: "returns whether the decimal is ninety four.",
|
|
1486
|
-
examples: [
|
|
1487
|
-
"94.0.ninety_four?",
|
|
1488
|
-
"95.0.ninety_four?",
|
|
1489
|
-
"0.5.ninety_four?"
|
|
1490
|
-
]
|
|
884
|
+
examples: %w[94.0.ninety_four? 95.0.ninety_four? 0.5.ninety_four?]
|
|
1491
885
|
},
|
|
1492
886
|
"ninety_five?" => {
|
|
1493
887
|
name: "ninety_five?",
|
|
1494
888
|
description: "returns whether the decimal is ninety five.",
|
|
1495
|
-
examples: [
|
|
1496
|
-
"95.0.ninety_five?",
|
|
1497
|
-
"96.0.ninety_five?",
|
|
1498
|
-
"0.5.ninety_five?"
|
|
1499
|
-
]
|
|
889
|
+
examples: %w[95.0.ninety_five? 96.0.ninety_five? 0.5.ninety_five?]
|
|
1500
890
|
},
|
|
1501
891
|
"ninety_six?" => {
|
|
1502
892
|
name: "ninety_six?",
|
|
1503
893
|
description: "returns whether the decimal is ninety six.",
|
|
1504
|
-
examples: [
|
|
1505
|
-
"96.0.ninety_six?",
|
|
1506
|
-
"97.0.ninety_six?",
|
|
1507
|
-
"0.5.ninety_six?"
|
|
1508
|
-
]
|
|
894
|
+
examples: %w[96.0.ninety_six? 97.0.ninety_six? 0.5.ninety_six?]
|
|
1509
895
|
},
|
|
1510
896
|
"ninety_seven?" => {
|
|
1511
897
|
name: "ninety_seven?",
|
|
1512
898
|
description: "returns whether the decimal is ninety seven.",
|
|
1513
|
-
examples: [
|
|
1514
|
-
"97.0.ninety_seven?",
|
|
1515
|
-
"98.0.ninety_seven?",
|
|
1516
|
-
"0.5.ninety_seven?"
|
|
1517
|
-
]
|
|
899
|
+
examples: %w[97.0.ninety_seven? 98.0.ninety_seven? 0.5.ninety_seven?]
|
|
1518
900
|
},
|
|
1519
901
|
"ninety_eight?" => {
|
|
1520
902
|
name: "ninety_eight?",
|
|
1521
903
|
description: "returns whether the decimal is ninety eight.",
|
|
1522
|
-
examples: [
|
|
1523
|
-
"98.0.ninety_eight?",
|
|
1524
|
-
"99.0.ninety_eight?",
|
|
1525
|
-
"0.5.ninety_eight?"
|
|
1526
|
-
]
|
|
904
|
+
examples: %w[98.0.ninety_eight? 99.0.ninety_eight? 0.5.ninety_eight?]
|
|
1527
905
|
},
|
|
1528
906
|
"ninety_nine?" => {
|
|
1529
907
|
name: "ninety_nine?",
|
|
1530
908
|
description: "returns whether the decimal is ninety nine.",
|
|
1531
|
-
examples: [
|
|
1532
|
-
"99.0.ninety_nine?",
|
|
1533
|
-
"100.0.ninety_nine?",
|
|
1534
|
-
"0.5.ninety_nine?"
|
|
1535
|
-
]
|
|
909
|
+
examples: %w[99.0.ninety_nine? 100.0.ninety_nine? 0.5.ninety_nine?]
|
|
1536
910
|
},
|
|
1537
911
|
"one_hundred?" => {
|
|
1538
912
|
name: "one_hundred?",
|
|
1539
913
|
description: "returns whether the decimal is one hundred.",
|
|
1540
|
-
examples: [
|
|
1541
|
-
"100.0.one_hundred?",
|
|
1542
|
-
"101.0.one_hundred?",
|
|
1543
|
-
"0.5.one_hundred?"
|
|
1544
|
-
]
|
|
914
|
+
examples: %w[100.0.one_hundred? 101.0.one_hundred? 0.5.one_hundred?]
|
|
1545
915
|
}
|
|
1546
916
|
}.freeze
|
|
1547
917
|
|
|
@@ -2171,7 +1541,10 @@ class Code
|
|
|
2171
1541
|
|
|
2172
1542
|
def code_to_precision(precision = nil)
|
|
2173
1543
|
code_precision = precision.to_code
|
|
2174
|
-
code_precision =
|
|
1544
|
+
code_precision =
|
|
1545
|
+
Integer.new(
|
|
1546
|
+
raw.to_s("F").delete(".-").length
|
|
1547
|
+
) if code_precision.nothing?
|
|
2175
1548
|
|
|
2176
1549
|
String.new(format("%.#{code_precision.raw}g", raw))
|
|
2177
1550
|
end
|