On Mon, Oct 22, 2007 at 2:24 PM, via RT Paul Cochrane <[EMAIL PROTECTED]> wrote:
> "TODO mul<Integer, Complex>" The attached patch is a simple implementation using mul<Complex,Integer> and adds the operation in the multiply test in complex.t (don't know if it's the correct place). -- Salu2
Index: src/pmc/integer.pmc =================================================================== --- src/pmc/integer.pmc (revisión: 27253) +++ src/pmc/integer.pmc (copia de trabajo) @@ -20,6 +20,7 @@ */ #include "parrot/parrot.h" +#include "pmc_complex.h" /* RT#46619 create MMD headers to in Pmc2c.pm */ extern INTVAL Parrot_BigInt_is_equal_BigInt(PARROT_INTERP, PMC*, PMC*); @@ -596,8 +597,8 @@ return overflow(INTERP, SELF, b, dest, MMD_MULTIPLY); } MMD_Complex: { - real_exception(INTERP, NULL, E_NotImplementedError, - "RT#46629 mul<Integer, Complex>"); + return Parrot_Complex_multiply_int(INTERP, value, + SELF.get_integer(), dest); } MMD_BigInt: { return Parrot_BigInt_multiply_int(INTERP, value, Index: t/pmc/complex.t =================================================================== --- t/pmc/complex.t (revisión: 27253) +++ t/pmc/complex.t (copia de trabajo) @@ -320,6 +320,11 @@ mul P1, P0, P3 print P1 print "\n" + + mul P1, P3, P0 + print P1 + print "\n" + end CODE -5+12i @@ -331,6 +336,7 @@ 2-2i 1-1i 10+10i +10+10i OUTPUT pasm_output_is( <<'CODE', <<'OUTPUT', "divide" );