MathGroup Archive 1996

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

Search the Archive

Re: Q: How to force an Equal[]

  • Subject: [mg3363] Re: [mg3332] Q: How to force an Equal[]
  • From: richard at seuss.math.wright.edu (Richard Mercer)
  • Date: 2 Mar 1996 11:17:37 -0600
  • Approved: usenet@wri.com
  • Distribution: local
  • Newsgroups: wri.mathgroup
  • Organization: Wolfram Research, Inc.
  • Sender: daemon at wri.com

>  Hi there,
>  

>  this should be a nice relaxing one. How can I force Mma
>  to evaluate the equal expression, regardless of what
>  values Word or Number stand for. I just want a false in
>  the second case (y1==y2).
>  ......

I learned a long time ago to use == ONLY for numerical equalities and  
use === for other things. The truth is not quite that simple, but this  
simple rule will generally keep you out of trouble. Also avoid using ==  
with exact numerical expressions, e.g. with
a = 2 + Sqrt[2]; b = 2/(2 - Sqrt[2]);
a == b   does not evaluate.
a === b  gives False
N[a] == N[b] gives True

So y1 === y2 ought to do the trick here. (Haven't tried it.)
You can also use TrueQ[y1==y2] to force a decision. This always yields  
True or False, defaulting to False.

Richard Mercer


  • Prev by Date: Re: Q: How to force an Equal[]
  • Next by Date: Re: ArcTan[x,y]
  • Previous by thread: Re: Q: How to force an Equal[]
  • Next by thread: Re: ArcTan[x,y]