I believe:

Calculators typically use base 10 calculations, computers typically employ base 2. In base 2 the numbers here can't be represented exactly because each term in the binary sequence (1/(2^n)) can only get arbitrarily close to the number. In base 10 the number can be represented exactly.

When you limit the precision of binary calculations to some number of places n, the binary machine code likely automatically rounds at the n + 1 digit, like the format() function.

PCs use IEEE calculations and truncate without rounding, giving the binary result. One of the reasons the IEEE was requested to standardize was to eliminate the differences between results given by different OS's.

Cheers,

Art



On Jul 28, 2006, at 11:58 AM, realbasic-nug- [EMAIL PROTECTED] wrote:

Subject: Re: Re: Math Error?
From: "Peter K. Stys" <[EMAIL PROTECTED]>
Date: Fri, 28 Jul 2006 10:53:51 -0400

On 7/28/06, Phil M <[EMAIL PROTECTED]> wrote:
On Jul 28, 2006, at 10:35 AM, Peter K. Stys wrote:

Interesting discussion.  To muddy the waters further, using
Mathematica:

N[72/2000, 100] (ie calculate to 100 significant digits of precision)

you get:

0.036000000000000000000000000000000000000000000000000000000000000000 00
000000000000000000000000000000000

No argument here, 72/2000 is really 0.036 exactly.

As people said, this real number may not be representable exactly as a
binary floating point number, however:

N[72/2000]  (calculate to machine precision)

gives 0.036, implying that the machine is indeed able to represent
0.036 exactly.

Yes, Calculator.app shows exactly "0.036" even with 16 digit
precision.  Now try "0.036 * 750".



In[26]:= N[72/2000*750,100]

Out[26]= 27.0000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000

In[27]:= N[72/2000*750]

Out[27]= 27.

Still suggests all these numbers and intermediate results are
representable exactly at machine precision.

Odd indeed.

P.

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to