Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2001
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2001

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

Search the Archive

Zero does not Equal Zero

  • To: mathgroup at smc.vnet.net
  • Subject: [mg31224] Zero does not Equal Zero
  • From: "Ersek, Ted R" <ErsekTR at navair.navy.mil>
  • Date: Fri, 19 Oct 2001 03:12:28 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Hello Group,

I am using Mathematica Version 4.1.0.0 under Windows 98, but I suspect it
makes no difference what platform is used. 

The following demonstrates an inconsistency with arbitrary precision
arithmetic. The problem is that the criteria for deciding what numbers are
displayed as zero is different from the criteria for deciding if a number
equals zero.


In[1]:=
  x=SetPrecision[1234567890123456789012, 21.35];
  y=x-6/5;
  {x-y, x-y==0}

Out[3]=
  {0., False}


----------
For what it's worth, the next line shows that the precision of (x-y) is
(0.0366) almost zero.

In[4]=
  InputForm[x-y]

Out[4]=
  1.2`0.0366

-----------
Regards, 
  Ted Ersek
  Check Mathematica Tips, Tricks at
  http://www.verbeia.com/mathematica/tips/Tricks.html



  • Prev by Date: Re: Limit and Abs
  • Next by Date: Re: How can export {1,5,9} into a TXT file as the format as 1 5 9?
  • Previous by thread: RootSearch package on MathSource
  • Next by thread: Re: Zero does not Equal Zero