On 7/28/06, Norman Palardy <npalardy at great-white-software dot com> wrote:
On Jul 28, 2006, at 8:53 AM, Peter K. Stys wrote:
>
> 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.
I'm quite certain that 72/2000 is not.
Write it as the simple sum of powers of 2 and you find the problem.
72/2000 = 2^-2 + 2^-4 + 2^-5 + 2^-6 + 2^-11 + 2^-15 ..... and so on
and you never get exactly the result you get from 72/2000.
In the machine all you have is powers of 2
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
-------------------------------------------------------------------------------
_______________________________________________
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>
From Fri 28 Jul 2006 10:36:18 -0600
Return-Path: <realbasic-nug-bounces at lists dot realsoftware dot com>
X-Original-To: listarchive at realsoftware dot com
Delivered-To: listarchive at realsoftware dot com
Received: by xmail.realsoftware.com (Postfix, from userid 1037)
id 9970F8CC6B0; Fri, 28 Jul 2006 09:36:45 -0700 (PDT)
X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on realxserve.local
X-Spam-Level:
X-Spam-Status: No, score=-2.7 required=4.5 tests=AWL,BAYES_00,NO_REAL_NAME
autolearn=no version=3.1.1
Received: from lists.realsoftware.com (lists.realsoftware.com [209.198.132.125])
by xmail.realsoftware.com (Postfix) with ESMTP id 9DEE78CC6AA;
Fri, 28 Jul 2006 09:36:44 -0700 (PDT)
Received: from lists.realsoftware.com (localhost [127.0.0.1])
by lists.realsoftware.com (Postfix) with ESMTP
id DDC2813D6062; Fri, 28 Jul 2006 11:36:32 -0500 (CDT)
X-Original-To: realbasic-nug at lists dot realsoftware dot com
Delivered-To: realbasic-nug at lists dot realsoftware dot com
Received: from swarthymail-a5.dreamhost.com (sd-green-bigip-61.dreamhost.com
[208.97.132.61])
by lists.realsoftware.com (Postfix) with ESMTP id 56A2013D6053
for <realbasic-nug at lists dot realsoftware dot com>;
Fri, 28 Jul 2006 11:36:26 -0500 (CDT)
Received: from [66.116.103.197] (unknown [66.116.103.197])
by swarthymail-a5.dreamhost.com (Postfix) with ESMTP id ADBF1109EAE
for <realbasic-nug at lists dot realsoftware dot com>;
Fri, 28 Jul 2006 09:36:25 -0700 (PDT)
Date: Fri, 28 Jul 2006 10:36:18 -0600
From: joe at strout dot net
To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
In-Reply-To: <40eddf340607280832r29179987y3b439b714e8f20a3 at mail dot gmail dot
com>
X-Mailer: VerEx Email Gateway
Content-type: text/plain;
Content-transfer-encoding: 7bit
Message-Id: <20060728163625 dot ADBF1109EAE at swarthymail-a5 dot dreamhost dot
com>
Subject: Re: RBScript
X-BeenThere: realbasic-nug at lists dot realsoftware dot com
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Sender: realbasic-nug-bounces at lists dot realsoftware dot com
Errors-To: realbasic-nug-bounces at lists dot realsoftware dot com
On Jul 28, 2006, at 15:32 UTC, Walter Purvis wrote [regarding the use of
RBScript]:
I am discouraged by the likely
futility of it all, given the crashing bugs, the general and
completely baffling neglect on the part of REAL, and (which follows)
the absence of things like PartialRun and decent threading/yielding
behavior that would be needed in most (albeit not all) applications of
RBScript that I've ever had in mind.
Agreed. Though it hasn't been *completely* neglected -- it has become an
integral part of the IDE, so hopefully this means it will get a bit more
attention.
My understanding was that Swordfish... was going to use RBScript.
I don't know where you got that idea. It certainly was not my understanding.
Best,
- Joe
--
Joe Strout -- joe at strout dot net
Verified Express, LLC "Making the Internet a Better Place"
http://www.verex.com/
_______________________________________________
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>
|