       Re: More on Positive[x]

• To: mathgroup at smc.vnet.net
• Subject: [mg7920] Re: More on Positive[x]
• From: bruck at pacificnet.net (Ronald Bruck)
• Date: Mon, 21 Jul 1997 03:22:10 -0400
• Organization: University of Southern California
• Sender: owner-wri-mathgroup at wolfram.com

```In article <5qkea7\$97k at smc.vnet.net>, Raya Firsov-Khanin
<raya at mech.ed.ac.uk> wrote:

:Hi,
:
:Thanks to everybody for replying to my question on how to declare a
:variable positive. I just want to add that if you declare
:
:Positive[x] ^= True
:
:Positive[x] gives you True. However, Positive[1/x] or Positive[x*y] (where
:Positive[y] ^=True) remain unevaluated. So, to work with positive variables
:one needs to formulate a few rules, namely
:
:Unprotect[Positive];
:Positive[1/x_] := Positive[x];
:Positive[x_*y_] := Positive[x]&&Positive[y];
:Positive[x_/y_] := Positive[x]&&Positive[y];
:Positive[x_^n_] := Positive[x];
:Protect[Positive];

One of the pitfalls of modifying a built-in function ;-)

What happens if x and y are both NEGATIVE and you apply your second or
third rules?  What happens if x is negative and n is even, in your third
rule?

--Ron Bruck

Now 100% ISDN from this address

```

• Prev by Date: Re: Problem with Conditiond Function
• Next by Date: Table of euclidean distances...
• Previous by thread: Speeding up calculations by lowering the precision ?
• Next by thread: Table of euclidean distances...