Skip to content

Commit

Permalink
Logic in place, but no new code.
Browse files Browse the repository at this point in the history
  • Loading branch information
colomon committed Jun 23, 2010
1 parent 14ca7e7 commit 7cae076
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/str2num.pm
Expand Up @@ -56,7 +56,15 @@ our sub str2num-parse($s) is export {
our sub str2num($s) is export {
my ($negate, $int-part, $frac-part, $exp-part) = str2num-parse($s);

my $result = $int-part.Int;
my $result;
if $exp-part {
# Num
} elsif $frac-part {
# Rat
} else {
# Int
$result = $int-part.Int;
}
$result = -$result if $negate;
$result;
}
Expand Down

0 comments on commit 7cae076

Please sign in to comment.