MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Arg[z] that works with zero argument?


One possible solution is:

Unprotect[Arg];
Arg[z_] /; Chop[z] == 0 = 0;
Protect[Arg];

The result is:

(In[])  {Arg[0], Arg[0.], Arg[1.*^-15 + 1.*^-12I], Arg[{0., I}]}
(Out[]) {0, 0, 0, {0, Pi/2}}

AES/newspost wrote:

>I'd like a simple Arg[z] function that would "work" [return some simple 
>value; zero is OK] for zero argument values, even if z is a list.
>
>My simplest kludge so far is
>
>    myArg[z_] := Module[{eps=10^(-17)}, Arg[z+eps]]
>
>Seems to work OK so far -- better ways to do this?
>
>  
>



  • Prev by Date: help on Rewrite rules
  • Next by Date: Re: Arg[z] that works with zero argument?
  • Previous by thread: Arg[z] that works with zero argument?
  • Next by thread: Re: Arg[z] that works with zero argument?