Re: [perl #60674] sign($x) always returns 1 when $x ~~ Complex

2008-11-20 Thread Wolfgang Laun
If a programmer calls a function with an argument that has a well-established type, s/he may very well expect a result according to that type, (considering that overloading isn't just a word for not caring about type). So, calling sqrt with a real < 0, should not come back with a complex number. C

Re: [perl #60674] sign($x) always returns 1 when $x ~~ Complex

2008-11-20 Thread TSa
HaloO, Moritz Lenz via RT wrote: On Wed Nov 19 07:35:48 2008, masak wrote: what should the behaviour of sign($x) be when $x is complex? I'd argue that it's a Failure. This is a bit drastic. If one computes in the complex domain a complex valued sign function is appropriate. multi sub s

[perl #60702] parrot-0.8.1 rakudo crashes glibc-2.7 (repeat from the parrot list)

2008-11-20 Thread via RT
# New Ticket Created by Ross Alexander # Please include the string: [perl #60702] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=60702 > Hello, I have already sent this to the parrot list but I noticed a post saying rakodo

Re: [perl #60674] sign($x) always returns 1 when $x ~~ Complex

2008-11-20 Thread Mark J. Reed
I'd rather retain the dwimmishness of p5. $ perl -MMath::Complex -le 'print sqrt(-1)' i Note that I didn't have to pass in Math::Complex->make(-1,0). Just -1. On 11/20/08, Chris Dolan <[EMAIL PROTECTED]> wrote: >> Mark (>): >>> I think the most sensible thing is to be consistent. sgn() fails

Re: [perl #60674] sign($x) always returns 1 when $x ~~ Complex

2008-11-20 Thread Chris Dolan
> Mark (>): >> I think the most sensible thing is to be consistent. sgn() fails for >> non-real input as long as sqrt() returns NaN for negative input. >> Change the latter behavior (via a pragma or whatever) so that sqrt() >> returns complex numbers, and then sgn() should start behaving on such >

Re: [perl #60674] sign($x) always returns 1 when $x ~~ Complex

2008-11-20 Thread Larry Wall
On Thu, Nov 20, 2008 at 04:31:22PM +0100, Carl Mäsak wrote: : Mark (>): : > I think the most sensible thing is to be consistent. sgn() fails for : > non-real input as long as sqrt() returns NaN for negative input. : > Change the latter behavior (via a pragma or whatever) so that sqrt() : > returns

Re: [perl #60674] sign($x) always returns 1 when $x ~~ Complex

2008-11-20 Thread Carl Mäsak
Mark (>): > I think the most sensible thing is to be consistent. sgn() fails for > non-real input as long as sqrt() returns NaN for negative input. > Change the latter behavior (via a pragma or whatever) so that sqrt() > returns complex numbers, and then sgn() should start behaving on such > numbe

Re: [perl #60674] sign($x) always returns 1 when $x ~~ Complex

2008-11-20 Thread Mark J. Reed
On Thu, Nov 20, 2008 at 8:34 AM, Carl Mäsak <[EMAIL PROTECTED]> wrote: > I guess the question is more about the programmer's expectations. Is > this a case where we serve the programmer better by returning Failure, > or by generalizing the C function to the complex plane? This is parallel to the c

Re: [perl #60674] sign($x) always returns 1 when $x ~~ Complex

2008-11-20 Thread Carl Mäsak
Wolfgang (>): > There is a definition for the signum function for a complex argument. > > sign( z ) = z / |z| for all z != 0 > sign( 0 ) = 0 > > See e.g. http://en.wikipedia.org/wiki/Sign_function > > Shouldn't be too difficult to implement. It isn't, and note that I also proposed it in my first e

RE: [perl #60674] sign($x) always returns 1 when $x ~~ Complex

2008-11-20 Thread Wolfgang Laun
There is a definition for the signum function for a complex argument. sign( z ) = z / |z| for all z != 0 sign( 0 ) = 0 See e.g. http://en.wikipedia.org/wiki/Sign_function Shouldn't be too difficult to implement. -Original Message- From: Carl Mäsak [mailto:[EMAIL PROTECTED] Sent: Mittw

[perl #60674] sign($x) always returns 1 when $x ~~ Complex

2008-11-20 Thread Carl Mäsak
# New Ticket Created by "Carl Mäsak" # Please include the string: [perl #60674] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=60674 > what should the behaviour of sign($x) be when $x is complex? rakudo: say sign($_) for

[perl #60670] Implement Texas quotes («») i n Rakudo

2008-11-20 Thread Carl Mäsak
# New Ticket Created by "Carl Mäsak" # Please include the string: [perl #60670] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=60670 > Rakudo r32873 cannot parse the Unicode version of Texas quotes («»), and misunderstands

[perl #60672] Implement %C in sprintf in Rakudo

2008-11-20 Thread Carl Mäsak
# New Ticket Created by "Carl Mäsak" # Please include the string: [perl #60672] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=60672 > According to S29, there should be an sprintf directive %C, but Rakudo r32874 doesn't rec