Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Real: document how to convert string to number
  • Loading branch information
rudis committed Feb 20, 2016
1 parent 67b3028 commit 24b25db
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 24b25db

Please sign in to comment.