Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
better format complex numbers
  • Loading branch information
perlpilot committed Feb 9, 2011
1 parent 184bf7f commit 03380cd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/Complex.pm
Expand Up @@ -27,7 +27,8 @@ class Complex does Numeric is Cool {
multi method Complex() { self }

method Str() {
"$.re + {$.im}i";
my $op = $.im < 0 ?? '-' !! '+';
"$.re $op {$.im.abs}i";
}

multi method perl() {
Expand Down

0 comments on commit 03380cd

Please sign in to comment.