Services & Resources / Wolfram Forums
MathGroup Archive
*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
  • Subject: [mg25696] Re: Bugs in Abs and Sign !?
  • From: Brian Higgins <bghiggins at>
  • Date: Thu, 19 Oct 2000 04:35:23 -0400 (EDT)
  • References: <8sjkr7$>
  • Sender: owner-wri-mathgroup at

Jack, There is no bug in my opinion. Mathematica is doing pricesly
what you requested. When you use replacement rules it is wise to
carefully examine the FullForm  of your expression. Thus

FullForm[Abs[x^2] ]

Power[Abs[x], 2]


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

will give

Power[ fnt[x] , 2]

which is


The correct replacement rule for what you want to do is

Abs[x^2] /. Abs -> fnt



In article <8sjkr7$g3p at>,
  Jack Goldberg <jackgold at> wrote:
> 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
> 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

Sent via
Before you buy.

  • Prev by Date: Re: Bugs in Abs and Sign !?
  • Next by Date: RE: machine size real number
  • Previous by thread: Re: Bugs in Abs and Sign !?
  • Next by thread: Re: Bugs in Abs and Sign !?