Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Implement constant i for complex numbers
constant i = 1i; had bootstrappy problems last I tried, but now
we can simply write Complex.new(0, 1) on the RHS. jnthn++
  • Loading branch information
moritz committed Mar 3, 2012
1 parent 715aed6 commit 06cf161
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/core/Complex.pm
Expand Up @@ -403,4 +403,6 @@ multi postfix:<i>(Complex:D \$a) returns Complex:D { Complex.new(-$a.im, $a.re)
multi postfix:<i>(Numeric \$a) returns Complex:D { $a * Complex.new(0e0, 1e0) }
multi postfix:<i>(Cool \$a) returns Complex:D { $a.Numeric * Complex.new(0e0, 1e0) }

constant i = Complex.new(0e0, 1e0);

# vim: ft=perl6

0 comments on commit 06cf161

Please sign in to comment.