MathGroup Archive 2007

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

Search the Archive

Re: Sign Declaration

Specifying the sign of an expression by using Sign[var]^=1 or x/:Sign[x]=1 is not recommended, as these have the potential to interact poorly with built-in functions. A better way is to use the assumptions mechanism:

In[1]:= $Assumptions = {Sign[x]==1};

In[2]:= Refine[Sign[x^2]]

Out[2]= 1

In[3]:= Simplify[Sign[x^2]]

Out[3]= 1

Wolfram Research

  • Prev by Date: Unexpected errors when searching documentation for ``
  • Next by Date: Manipulating current read position in a binary file
  • Previous by thread: Re: Sign Declaration
  • Next by thread: Re: Sign Declaration