File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -220,6 +220,32 @@ say "foo[bar][baz]bada".match('ba', :x(2)); # OUTPUT: «(「ba」 「ba」
220
220
221
221
= end code
222
222
223
+ = head2 method Numeric
224
+
225
+ Defined as:
226
+
227
+ method Numeric(Str:D: --> Numeric:D)
228
+
229
+ Coerces the string to L < Numeric > . L < Fails|/routine/fail > with C < X::Str::Numeric >
230
+ if the coersion cannot be done.
231
+
232
+ Only Unicode characters with property C < Nd > , as well as leading and trailing
233
+ whitespace are allowed, with the special case of the empty string being coerced
234
+ to C < 0 > . Synthetic codepoints (e.g. C < "7\x[308]" > ) are forbidden.
235
+
236
+ While C < Nl > and C < No > characters can be used as numeric literals
237
+ in the language, their conversion via C < Str.Numeric > will fail, by design.
238
+ See L « unival|/routine/unival » if you need to coerse such characters to
239
+ C < Numeric > .
240
+
241
+ = head2 method Int
242
+
243
+ Defined as:
244
+
245
+ method Int(Str:D: --> Int:D)
246
+
247
+ Coerces the string to L < Int > , using the same rules as
248
+ L « C < Str.Numeric > |/type/Str#method_Numeric>.
223
249
224
250
= head2 routine parse-base
225
251
You can’t perform that action at this time.
0 commit comments