Skip to content

Commit

Permalink
implement .re and .im in Complex
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed Mar 10, 2009
1 parent 531ca2c commit d8f59ef
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/classes/Complex.pir
Expand Up @@ -151,11 +151,23 @@ Casts a value to a complex number.
.return ($P0)
.end

=item im

=cut

.namespace ['Perl6Complex']

.sub 'im' :method :multi(_)
$N0 = self[1]
.return ($N0)
.end

=item infix:+

=cut

.namespace []

.sub 'infix:+' :multi('Complex', _)
.param pmc a
.param pmc b
Expand Down Expand Up @@ -253,6 +265,17 @@ Casts a value to a complex number.
.return ($P0)
.end

=item re

=cut

.namespace ['Perl6Complex']

.sub 're' :method :multi(_)
$N0 = self[0]
.return ($N0)
.end

=back

=cut
Expand Down

0 comments on commit d8f59ef

Please sign in to comment.