Re: ! operator
- To: mathgroup at smc.vnet.net
- Subject: [mg55932] Re: ! operator
- From: dh <dh at metrohm.ch>
- Date: Sun, 10 Apr 2005 23:07:08 -0400 (EDT)
- References: <d3b18l$sgd$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
DongGook
"!" has two meainings as a prefix operator (and even an additional one
as a postfix),namely the Not and the Pipe operator. Now Matematica has
to decide what you mean. If "!" is the first character on a new line,
Mathematica interpretes "!" as the Pipe character. On the other hand, if
you write e.g.:
t=!MemeberQ...
Mathematica interpretes "!" as the Not operator.
Sincerely, Daniel
DongGook Park wrote:
> Hi,
>
> Could you explain a mysterious behaviour of "! operator" as shown below?
>
>
> In[43]:=
> MemberQ[{1,2,3},3]
>
> Out[43]=
> True
>
> In[47]:=
> !MemberQ[{1,2,3},3]
> (* Here Mathematica does not give any response! *)
>
> In[48]:=
> Not@MemberQ[{1,2,3},3]
>
> Out[48]=
> False
>
>
> Considering the description from Mathematica help:
> "!expr is the logical NOT function. It gives False if expr is True,
> and True if it is False."
> This behaviour seems quite suspicious?
>
>
> DongGook
>
>
> ----------------------------------
> DongGook Park,
> School of Information Technology,
> SunChon University, Korea
> Telephone: +82 61 750 3597
> Mobile: +82 18 732 2125
> Home page: http://www.dgpark6.com/
> Email: dgpark6 at sunchon.ac.kr
>
>