MathGroup Archive 1997

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

Search the Archive

Re: Question on Positive[x]=True

  • To: mathgroup at
  • Subject: [mg7946] Re: Question on Positive[x]=True
  • From: Dick Zacher <dick at>
  • Date: Fri, 25 Jul 1997 02:40:22 -0400
  • Organization: Tandem Computers
  • Sender: owner-wri-mathgroup at

Raya Firsov-Khanin <raya at> wrote:

   > I have the following question.  I want to state that a variable 
   > x is positive. On page 1170 of the Third edition of The Mathematica
   > it is said that I can do it by making a definition
   >     Positive[x] = True 
   > However, while trying to do it I get a message : 
   > Set::write: Tag Positive in Positive[x] is Protected 
   > Any suggestions on how one can make variables positive, negative

I have seen several postings in response to Raya's query, but none of
them mentions this crucial point: To specify that a variable is
positive, it is far more useful to specify an upvalue for Sign than for
Positive. The reason is that Positive tests the value of Sign for the
variable, but the reverse is not true. If you set upvalues for Sign,
then you will automatically get correct results for both Positive and
Negative -- not only when you test the variables themselves, but also
when you test products, quotients, and integral powers of the variables.
You don't have to write special rules to handle these cases. Some


"Solaris 3.0 (November 22, 1996)"

Sign[a] ^= 1;
Sign[b] ^= 1;
Sign[q] ^= -1;
Sign[r] ^= -1;







Dick Zacher                    
Performance Engineering Dept., Tandem Computers
zacher_dick at     phone: 408-285-5746     fax:   408-285-7079

  • Prev by Date: [Q]contour integral in MMA3.0
  • Next by Date: Minima
  • Previous by thread: Re: Question on Positive[x]=True
  • Next by thread: Q: Help on Plotting with Mathematica