Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

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

  • To: mathgroup at smc.vnet.net
  • Subject: [mg50863] Re: [mg50860] Arg[z] that works with zero argument?
  • From: "Maxim A. Dubinnyi" <maxim at nmr.ru>
  • Date: Sat, 25 Sep 2004 01:55:01 -0400 (EDT)
  • References: <200409240841.EAA21781@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

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?