Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #6739

Re: Using Equal with Real Numbers

From Alan <alan.isaac@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Using Equal with Real Numbers
Date 2011-11-25 10:10 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <janpho$b7a$1@smc.vnet.net> (permalink)
References <jalb8i$s6h$1@smc.vnet.net>

Show all headers | View raw


On Nov 24, 6:53 am, Gabriel Landi <gtla...@gmail.com> wrote:
> (This actually depends on the OS and perhaps other things). The point is
> that he recognizes 0.6 as a member of list1 but not 0.7, even though
> both have the same InputForms.


Can you please explain this in more detail?  I assume this turn on the
fact that "MemberQ tests for structural matches, not numerical
equality", but how can I see the structural mismatch? Why does it only
apply to 0.7? I.e.,

lst1 = {0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0};
lst2 = Range[0, 1, 0.1];
Map[MemberQ[lst2, #] &, lst1]

=> {True, True, True, True, True, True, True, False, True, True, True}

Thanks,
Alan Isaac

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Using Equal with Real Numbers Gabriel Landi <gtlandi@gmail.com> - 2011-11-24 11:53 +0000
  Re: Using Equal with Real Numbers A Retey <awnl@gmx-topmail.de> - 2011-11-25 10:09 +0000
  Re: Using Equal with Real Numbers Alan <alan.isaac@gmail.com> - 2011-11-25 10:10 +0000
  Re: Using Equal with Real Numbers Richard Fateman <fateman@cs.berkeley.edu> - 2011-11-26 10:10 +0000

csiph-web