Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Document parse-base()
Added to Rakudo in
rakudo/rakudo@b1cbb8b
  • Loading branch information
zoffixznet committed Nov 14, 2016
1 parent 06707c8 commit 4b9944d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions doc/Type/Str.pod6
Expand Up @@ -168,6 +168,23 @@ Examples:
TODO
=head2 routine parse-base
multi sub parse-base(Str:D $num, Int:D $radix) returns Numeric
multi method parse-base(Str:D $num: Int:D $radix) returns Numeric
Performs the reverse of L«C<Numeric>|/routine/base» by converts a string

This comment has been minimized.

Copy link
@AlexDaniel

AlexDaniel Nov 14, 2016

Member

“by converts”

with a base-C<$radix> number to its base-10 L«C<Numeric>|/type/Numeric»

This comment has been minimized.

Copy link
@AlexDaniel

AlexDaniel Nov 14, 2016

Member

What is a “base-10 Numeric”?

equivalent. Will L«C<fail>|/routine/fail» if radix is not in range C<2..36>
or of the string being parsed contains characters that are not valid
for the specified base.
1337.base(32).parse-base(32).say; # 1337
'Perl6'.parse-base(30).say; # 20652936
'FF.DD'.parse-base(16).say; # 255.863281
See also: L«:16<FF> syntax for number literals|/syntax/Number%20literals»
=head2 routine split
=for code :skip-test
Expand Down

0 comments on commit 4b9944d

Please sign in to comment.