Re: Bugs in Abs and Sign !?
- To: mathgroup at smc.vnet.net
- Subject: [mg25717] Re: [mg25674] Bugs in Abs and Sign !?
- From: BobHanlon at aol.com
- Date: Thu, 19 Oct 2000 04:35:40 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
In a message dated 10/18/2000 3:42:54 AM, jackgold at umich.edu writes:
>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.
The functions are evaluated before the substitution
{Abs[x^2] , Sign[x^2]}
{Abs[x]^2, Sign[x]^2}
Release[Hold[Abs[x^2] ] /. Abs[u_] -> fnt[u] ]
fnt[x^2]
Bob Hanlon