Skip to content

Commit

Permalink
Complex negation
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.parrot.org/parrot/trunk@7200 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information
rubys committed Nov 29, 2004
1 parent 452e2cd commit 4112caa
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions classes/complex.pmc
Expand Up @@ -766,6 +766,23 @@ MMD_DEFAULT: {
IM(dest) = IM(SELF) / value;
}


/*

=item C<void neg(PMC *dest)>

Set C<dest> to the negated value of C<SELF>.

=cut

*/

void neg (PMC* dest) {
VTABLE_morph(INTERP, dest, enum_class_Complex);
RE(dest) = - RE(SELF);
IM(dest) = - IM(SELF);
}

/*

=item C<INTVAL is_equal (PMC* value)>
Expand Down

0 comments on commit 4112caa

Please sign in to comment.