# New Ticket Created by Vasily Chekalkin # Please include the string: [perl #56230] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=56230 >
Hello. There is implementation of prefix:+, prefix:-, sqrt, exp for Complex. More to come. -- Bacek.
diff --git a/languages/perl6/src/builtins/math.pir b/languages/perl6/src/builtins/math.pir index 1edd996..229648e 100644 --- a/languages/perl6/src/builtins/math.pir +++ b/languages/perl6/src/builtins/math.pir @@ -123,12 +123,18 @@ C<$x ** 0.5> =cut -.sub 'sqrt' +.sub 'sqrt' :multi(_) .param num a a = sqrt a .return (a) .end +.sub 'sqrt' :multi(Complex) + .param pmc a + a = sqrt a + .return (a) +.end + =item truncate @@ -172,12 +178,18 @@ constant I<e>. =cut -.sub 'exp' +.sub 'exp' :multi(_) .param num a a = exp a .return (a) .end +.sub 'exp' :multi(Complex) + .param pmc a + a = exp a + .return (a) +.end + =item log diff --git a/languages/perl6/src/builtins/op.pir b/languages/perl6/src/builtins/op.pir index 4d072fc..e8b4a29 100644 --- a/languages/perl6/src/builtins/op.pir +++ b/languages/perl6/src/builtins/op.pir @@ -80,6 +80,11 @@ src/builtins/op.pir - Perl6 builtin operators .return (a) .end +.sub 'prefix:+' :multi('Complex') + .param pmc a + .return (a) +.end + .sub 'prefix:-' :multi(_) .param num a @@ -94,6 +99,12 @@ src/builtins/op.pir - Perl6 builtin operators .return ($I0) .end +.sub 'prefix:-' :multi('Complex') + .param pmc a + a = neg a + .return (a) +.end + .sub 'prefix:~' :multi(_) .param string a