MathGroup Archive 2006

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

Search the Archive

Re: MemberQ

  • To: mathgroup at smc.vnet.net
  • Subject: [mg68536] Re: MemberQ
  • From: Bill Rowe <readnewsciv at earthlink.net>
  • Date: Wed, 9 Aug 2006 04:19:04 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

On 8/8/06 at 6:28 AM, vze269bv at verizon.net (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?

It is due to using inexact numbers, i.e.

In[22]:=
RealDigits[Range[0.,1.,.1][[8]]]

Out[22]=
{{7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0}

but

In[23]:=
RealDigits[.7]

Out[23]=
{{7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0}

In[24]:=
$Version

Out[24]=
5.2 for Mac OS X (June 20, 2005)
--
To reply via email subtract one hundred and four


  • Prev by Date: Re: MemberQ
  • Next by Date: Re: How to get the output of Minimize function in x = a format
  • Previous by thread: Re: MemberQ
  • Next by thread: Re: MemberQ