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: Mittwoch, 19. November 2008 22:24
To: [EMAIL PROTECTED]
Subject: Re: [perl #60674] sign($x) always returns 1 when $x ~~ Complex

Moritz (>), Carl (>>):
>> <masak> what should the behaviour of sign($x) be when $x is complex?
>
> I'd argue that it's a Failure.

Aye.

Reply via email to