MathGroup Archive 2005

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

Search the Archive

Re: ! operator


This bug is particularly odd, since Trace gives exactly the same results both ways:

!MemberQ[{1,2,3},3]//Trace

{{MemberQ[{1,2,3},3],True},!True,False}

Not@MemberQ[{1,2,3},3]//Trace

{{MemberQ[{1,2,3},3],True},!True,False}

The second statement (without Trace) outputs False, but the first yields nothing.

Bobby

On Sun, 10 Apr 2005 06:55:02 -0400 (EDT), DongGook Park <dgpark6 at sunchon.ac.kr> 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
>
>
>
>
>



-- 
DrBob at bigfoot.com


  • Prev by Date: Re: cannot evaluate in HelpBrowser (Win XP)
  • Next by Date: Emacs mode for Mathematica
  • Previous by thread: Re: ! operator
  • Next by thread: Re: ! operator