MathGroup Archive 2006

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

Search the Archive

Re: MemberQ


Î?/Î? Bruce Colletti έγÏ?αÏ?ε:
> Re Mathematica 5.2.0.0.
>
> Since 0.7 is in the set {0.0, 0.1, 0.2,..., 0.9, 1.0}, why does MemberQ[Range[0., 1., .1], .7] return False?
>
> Thankx.
>
> Bruce

I face the same problem with you (both in version 5.1 and 5.2).

However, the strange thing is that using version 4.0 everything works
fine!!! I

ndeed,

In[1]:=
$Version

Out[2]=
"4.0 for Microsoft Windows (April 21, 1999)"

In[3]:=
lst=Range[0,1,0.1]
Out[3]=
{0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.}

In[4]:=
MemberQ[lst,0.7]

Out[4]=
True

In[5]:=
FreeQ[lst,0.7]

Out[5]=
False

Cheers, 
Jim


  • Prev by Date: Re: MemberQ
  • Next by Date: Re: MemberQ
  • Previous by thread: Re: MemberQ
  • Next by thread: Re: MemberQ