MathGroup Archive 1996

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

Search the Archive

Re: Q: How to force an Equal[]

  • To: mathgroup at smc.vnet.net
  • Subject: [mg3363] Re: [mg3332] Q: How to force an Equal[]
  • From: Richard Mercer <richard at seuss.math.wright.edu>
  • Date: Sat, 2 Mar 1996 04:12:34 -0500
  • Sender: owner-wri-mathgroup at wolfram.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

==== [MESSAGE SEPARATOR] ====


  • Prev by Date: Re: quartile
  • Next by Date: Re: Q: How to force an Equal[]
  • Previous by thread: Re: quartile
  • Next by thread: Re: Q: How to force an Equal[]