Skip to content

Commit

Permalink
Add Complex.sign to v6.e
Browse files Browse the repository at this point in the history
  • Loading branch information
coke committed Feb 7, 2023
1 parent 586466e commit 34cf82a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/core.e/Complex.pm6
@@ -0,0 +1,8 @@
augment class Complex {
method sign(Complex:D: --> Complex:D) {
my $abs = self.abs;
$abs == 0 ?? 0i !! self / $abs
}
}

# vim: expandtab shiftwidth=4
1 change: 1 addition & 0 deletions tools/templates/6.e/core_sources
Expand Up @@ -6,6 +6,7 @@ src/core.e/PseudoStash.pm6
src/core.e/Grammar.pm6
src/core.e/EXPORTHOW.pm6
src/core.e/Int.pm6
src/core.e/Complex.pm6
src/core.e/Str.pm6
src/core.e/array_multislice.pm6
src/core.e/hash_multislice.pm6
Expand Down

0 comments on commit 34cf82a

Please sign in to comment.