Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2000
*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 2000

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

Search the Archive

Re: Bugs in Abs and Sign !?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg25686] Re: Bugs in Abs and Sign !?
  • From: "Allan Hayes" <hay at haystack.demon.co.uk>
  • Date: Thu, 19 Oct 2000 04:35:15 -0400 (EDT)
  • References: <8sjkr7$g3p@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Jack:

Abs[.] and Sign[.] evaluate before the replacement

Abs[x^2]

        Abs[x]^2

Sign[x^2]

        Sign[x]^2

Prevent this:

Unevaluated[Abs[x^2]] /. Abs[u_] -> fnt[u]

        fnt[x^2]

Unevaluated[Sign[x^2]] /. Sign[u_] -> fnt[u]

        fnt[x^2]
--
Allan
---------------------
Allan Hayes
Mathematica Training and Consulting
Leicester UK
www.haystack.demon.co.uk
hay at haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565

"Jack Goldberg" <jackgold at umich.edu> wrote in message
news:8sjkr7$g3p at smc.vnet.net...
> Hi group.
>
> Try,
>
> Abs[x^2] /. Abs[u_] -> fnt[u]
>
> and
>
> Sign[x^2] /. Sign[u_] -> fnt[u]
>
> In each case I get  fnt[x]^2.  Shouldn't I get  fnt[x^2]? After all,
> g[x^2] /. g[u_] -> fnt[u]  returns fnt[x^2] which is what I have been led
> to expect from Mathematica.  I am using ver 4.01 on a PowerMac.
>
> These peculiarities are driving me crazy.  This is the fourth "bug" I have
> found in just 2 weeks.  Please tell me I'm wrong.
>
> Thanks guys.
>
> Jack
>
>




  • Prev by Date: Re: AxesLabel for ContourPlot
  • Next by Date: Re: Select Output of FindMinimum
  • Previous by thread: Re: Bugs in Abs and Sign !?
  • Next by thread: Re: Bugs in Abs and Sign !?