Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #9781

Re: Question about DayOfWeek

From DrMajorBob <btreat1@austin.rr.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Question about DayOfWeek
Date 2012-04-25 04:34 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jn7utd$6cb$1@smc.vnet.net> (permalink)
References <201204240934.FAA24505@smc.vnet.net>

Show all headers | View raw


Use === (SameQ) rather than == (Equal).

To Equal, it is possible that Wednesday and Thursday are symbols with  
equal value.

Clear[x, y]
x == y
x == y (* returns unevaluated, since x and y may or may not be equal *)

x === y
False (* different expressions are not the same *)

Bobby

On Tue, 24 Apr 2012 04:34:58 -0500, Kent Holing <KHO@statoil.com> wrote:

> DayOfWeek[{1975,1,1}]==Wednesday gives True (as it should), but  
> DayOfWeek[{1975,1,1}]==Thursday gives
> Wednesday == Thursday and not False, as it should? Why is it so?
>


-- 
DrMajorBob@yahoo.com

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: Question about DayOfWeek DrMajorBob <btreat1@austin.rr.com> - 2012-04-25 04:34 +0000

csiph-web