Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1995
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1995

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

Search the Archive

Re: Declaring Variables as Real?

  • To: mathgroup at christensen.cybernetics.net
  • Subject: [mg1218] Re: Declaring Variables as Real?
  • From: RTighe at slac.stanford.edu (Richard Tighe)
  • Date: Fri, 26 May 1995 01:49:52 -0400
  • Organization: Stanford Linear Accelerator Center

In article <3prrks$533 at news0.cybernetics.net>, Lincoln Grimes
<lsgrimes at linus.mitre.org> wrote:

> I am evaluating some complex expressions with mma, and I want to be
> able to declare a variable as being real. I can do so for a single 
> expression with Complex Expand having no second argument, but I want to
be able
> to declare a variable as real for my entire notebook,so commands like
> Real and ComplexToTrig don't consider an imaginary part to my variables.  Is
> this possible?  Thanks.
> 
>                                                         Lincoln Grimes
>                                                         The Mitre Corp.
>                                                        
lsgrimes at linus.mitre.org

Use Im[var]^=0;

In[1]:= Re[x+I]

Out[1]= Re[x]

In[2]:= Im[y]^=0;

In[3]:= Re[y+I]
Out[3]= y



Richard Tighe
SLAC


  • Prev by Date: Re: Graphic Bugs
  • Next by Date: Re: Kernel Shutting Down - Help
  • Previous by thread: Declaring Variables as Real?
  • Next by thread: Mesh