realbasic-nug
[Top] [All Lists]

68k Was: Re: Math Error?

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: 68k Was: Re: Math Error?
From: William Squires <wsquires at satx dot rr dot com>
Date: Fri, 28 Jul 2006 19:06:16 -0500
Cc:
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <20060728174923 dot C9B7013D6A24 at lists dot realsoftware dot com>
IIRC, the 68040 uP from Motorola (now Freescale) had an extended format, too... at least for the "real" 68040 (not the LC040).

On Jul 28, 2006, at 12:45 PM, Joseph wrote:

If I recall correctly the intel chip has an "extended precision" format that
uses 80 bits when doing calculation.  These are used during calculation
regardless of the original floating point format. So if the values in the calculation are single precision (one's compliment 24 bit mantissa with an 8
bit exponent) the full 80 bits are used as 'guard bits' to increase the
precision of the calculation. Of course the result is then truncated to single precision. In High Level Assembly (Randall Hyde's interesting fusion of assembly and high level language constructs) you can declare an 80 bit
value.

~joe

-----Original Message-----
From: realbasic-nug-bounces at lists dot realsoftware dot com
[mailto:realbasic-nug-bounces at lists dot realsoftware dot com] On Behalf Of Peter K.
Stys
Sent: Friday, July 28, 2006 11:36 AM
To: REALbasic NUG
Subject: Re: Re: Math Error?
Actually we're both right and wrong:

In[55]:=RealDigits[0.036,2,100]

Out[55]={{1,0,0,1,0,0,1,1,0,1,1,1,0,1,0,0,1,0,1,1,1,1,0,0,0,1,1,0,1,0,1 ,0,0,
1,1,1,1,
1,1,0,1,1,1,1,1,0,0,1,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ,
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},-4}

Shows that 0.036 can be represented exactly in binary, but requires 51
significant digits (if I counted correctly to the last 1).  So with a
64 bit double, it probably just missed the # of digits in the mantissa
to represent 0.036 exactly.
Nuf time wasted on this, just a curiosity.

P.

--
----------------------------------------------------------------------- -----
---
Peter K. Stys, MD
Professor of Medicine(Neurology), Senior Scientist
Ottawa Health Research Institute, Div. of Neuroscience
Ottawa Hospital / University of Ottawa
Ontario, CANADA
tel:    (613)761-5444
fax:    (613)761-5330
http://www.ohri.ca/profiles/stys.asp
realsoftware.com/listarchives/lists.html>

_______________________________________________
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>


William H Squires Jr
4400 Horizon Hill #4006
San Antonio, TX 78229
wsquires at satx dot rr dot com dot nospam <- remove the .nospam

_______________________________________________
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>


<Prev in Thread] Current Thread [Next in Thread>