MathGroup Archive 2006

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

Search the Archive

Re: MemberQ

  • To: mathgroup at smc.vnet.net
  • Subject: [mg68557] Re: [mg68503] MemberQ
  • From: gardyloo <gardyloo at mail.wsu.edu>
  • Date: Wed, 9 Aug 2006 04:20:47 -0400 (EDT)
  • References: <200608081028.GAA29635@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi, Bruce,

   I suspect the same thing is happening here as in the documentation
for Position: the numbers are imprecise. It seems strange to me to do
this for MemberQ, but it works:

In[81]:=

MemberQ[Range[0, 1, 0.1], 

  _?(Inequality[0.69, Less, #1, LessEqual, 0.700001] & )]

Out[81]=

True


     Hope that helps!
                C.O.


Bruce Colletti wrote:
> 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
>
>
>   

-- 
==========================================================
Curtis Osterhoudt          
gardyloo at mail.remove_this.wsu.and_this.edu
PGP Key ID: 0x088E6D7A
Please avoid sending me Word or PowerPoint attachments
See http://www.gnu.org/philosophy/no-word-attachments.html
==========================================================


  • References:
    • MemberQ
      • From: Bruce Colletti <vze269bv@verizon.net>
  • Prev by Date: Re: MemberQ
  • Next by Date: How do I create a parametric expression?
  • Previous by thread: Re: MemberQ
  • Next by thread: Re: MemberQ