numbers near machine precision
- To: mathgroup at smc.vnet.net
- Subject: [mg47049] numbers near machine precision
- From: Steve Story <sbstory at ncsu.edu>
- Date: Mon, 22 Mar 2004 00:15:01 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
I'm in a numerical methods class, and having difficulty adapting the
subroutines to Mathematica. For one thing, it seems that the == operator
will pronounce two numbers equal when they're much further apart than
machine epsilon.
And I don't understand why this is, but it's easy to work around for the
routines I'm using. A bigger problem, however, is that when I try to
look at a machine-precise number in different number systems, sometimes
Mathematica says they're identical, sometimes not. And I can't find a
good resource about this. This problem is much more confusing to me.
Here's an example which I can't explain. In the first case, they're not
identical, in the second, they are:
In[132]:=
RealDigits[{a,b},2]
Out[132]=
{{{1,0,0,1,0,0,0,1,1,0,1,1,1,1,1,0,1,0,0,1,0,1,0,0,1,0,1,0,0,1,1,1,1,1,1,1,0,
1,1,0,1,1,0,0,1,1,0,0,1,1,0,0,0},2},{{1,0,0,1,0,0,0,1,1,0,1,1,1,1,1,0,1,
0,0,1,0,1,0,0,1,0,1,0,0,1,1,1,1,1,1,1,0,1,1,0,1,1,0,0,1,1,0,0,1,1,0,0,
1},2}}
In[135]:=
RealDigits[{a,b},16]
Out[135]=
{{{2,4,6,15,10,5,2,9,15,13,11,3,3},1},{{2,4,6,15,10,5,2,9,15,13,11,3,3},1}}
I don't understand why those things are happening in Mathematica. If anyone
could point me to a deep discussion of these topics in Mathematica, I'd
appreciate it.
thanks,
Steve Story