Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
omit . on Rat with 0 fractional digits
  • Loading branch information
TimToady committed Feb 14, 2015
1 parent 9c2dc10 commit 8862eb3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/core/Rational.pm
Expand Up @@ -102,9 +102,11 @@ my role Rational[::NuT, ::DeT] does Real {
$s ~= ($i+1).base($base) if $x == 0; # never happens?
}
}
$s ~= '.';
state @digits = '0'..'9', 'A'..'Z';
$s ~= @digits[@f].join;
if @f {
$s ~= '.';
state @digits = '0'..'9', 'A'..'Z';
$s ~= @digits[@f].join;
}
}
$s;
}
Expand Down

0 comments on commit 8862eb3

Please sign in to comment.