[Date Index] [Thread Index] [Author Index]
Re: Numerical accuracy/precision - this is a bug or a feature?
Richard, thanks for pointing this out. >From what you say, it seems that the documentation for SameQ is incorrect. On Thu, Jul 14, 2011 at 6:21 PM, Richard Fateman <fateman at eecs.berkeley.edu>wrote: > On 7/14/2011 6:22 AM, Christoph Lhotka wrote: > > Dear group! > > > .... > > > My question is: how dangerous is it to overwrite such a fundamental > > function as Equal? > > > > Best, > > > > Christoph > > > An excellent question. Anyone who runs Mathematica in serious > applications could try it > and report back. > > Unfortunately, SameQ doesn't operate the way I suspect you think it does. > > Consider a = 1.100000000000000000000000000; b=1.1 > > SameQ[a,b] is True. > > Yet a and b are different. You can see this if you do > SetPrecision[a,100] and SetPrecision[b,100]. > > 1.10000000000000000000000000000000000000117549435082228750796873653722\ > 2245677818665556772087521508752 > > 1.10000000000000008881784197001252323389053344726562500000000000000000\ > 0000000000000000000000000000000 > > RJF > >