MathGroup Archive 2009

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

Search the Archive

Re: confused about == vs === in this equality


On Oct 6, 5:06 am, Daniel Lichtblau <d... at wolfram.com> wrote:
> d... at wolfram.com wrote:
> >> ?===
> >> lhs===rhs yields True if the expression lhs is identical to rhs,=
 and
> >> yields
> >> False otherwise.
>
> >> ?==
> >> lhs==rhs returns True if lhs and rhs are identical.
>
> >> But looking at this example:
>
> >> a = ComplexInfinity;
> >>  If[a == ComplexInfinity, Print["YES"]]
>
> >> Expecting it would print "YES", but it does not. it just returns the w=
hole
> >> thing unevaluated? But
>
> >> If[a === ComplexInfinity, Print["YES"]]
>
> >> does return YES.
>
> >> I guess I am a little confused about the "expression" bit in the
> >> definition.
>
> >> So, when using the 3"=", it is looking at the _value_ of the express=
ion,
> >> but
> >> when using the 2"=", it is looking at the expression _as it is_, i.e=


  • Prev by Date: Re: using fourier transforms in mathematica
  • Next by Date: Re: Which is better, foo[n_Integer] or foo[n_?IntegerQ] ?
  • Previous by thread: Re: confused about == vs === in this equality
  • Next by thread: Re: Re: confused about == vs === in this equality