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


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

Re: Problem with "Which"

From Tutor <alfred.muehlleitner@gmx.at>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Problem with "Which"
Date 2011-10-22 10:17 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <j7u570$t90$1@smc.vnet.net> (permalink)
References <j7p1t7$5ks$1@smc.vnet.net> <j7rh96$haq$1@smc.vnet.net>

Show all headers | View raw


On 21 Okt., 12:24, Rui <rui.r...@gmail.com> wrote:
> Which tries it's arguments in turn until one yields true, AS LONG AS they yield false. If a condition yields neither True nor False, it returns the Which expression only partially evaluated, expecting that some day that expression might start yielding True or False. In your case, for example, if you ever assign x a value that makes -6+6 x be negative, then that Which will be resolved. Not sure what you expected...

As you can see: {Which[f2 > 0, "T", f2 < 0, "H", f2 == 0, "S" ], x,
f} /. ew] this expression is evaluated and it yields true for each x
in ew.

I think, he is expecting someting like {{H,0,0},{T,2,-4}}

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


Thread

Problem with "Which" mbmb <sb@9y.com> - 2011-10-20 11:49 +0000
  Re: Problem with "Which" Rui <rui.rojo@gmail.com> - 2011-10-21 10:24 +0000
    Re: Problem with "Which" Tutor <alfred.muehlleitner@gmx.at> - 2011-10-22 10:17 +0000
  Re: Problem with "Which" "Dr. Wolfgang Hintze" <weh@snafu.de> - 2011-10-21 10:25 +0000
  Re: Problem with "Which" "Oleksandr Rasputinov" <oleksandr_rasputinov@hmamail.com> - 2011-10-21 11:28 +0000

csiph-web