MathGroup Archive 2006

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

Search the Archive

Re: MemberQ


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
==========================================================


  • 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