Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #404 from rudis/master
Real: document how to convert string to number
  • Loading branch information
jonathanstowe committed Feb 20, 2016
2 parents 67b3028 + 24b25db commit d9293e9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions doc/Type/Real.pod
Expand Up @@ -76,4 +76,16 @@ The final digit produced is always rounded.
say pi.base(10, 5); # 3.14159
To convert a string to a number use the C<:16($number)> notation where 16 is
the base:
say :16("FF") # 255
say :23("FF") # 360
Converting to a dynamic base requires the Rakudo internal function
C<UNBASE()>:
my $base = 23;
say UNBASE($base, "FF") # 360
=end pod

0 comments on commit d9293e9

Please sign in to comment.