Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

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

Search the Archive

Re: MemberQ

  • To: mathgroup at smc.vnet.net
  • Subject: [mg68538] Re: MemberQ
  • From: dimmechan at yahoo.com
  • Date: Wed, 9 Aug 2006 04:19:06 -0400 (EDT)
  • References: <eb9pkt$t4j$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Î?/Î? 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