[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

LOGO-L> floating point errors in MSWLogo



Please reply to agauvin@umcs.maine.edu or logo-l@gsn.org NOT me.  I'm
just re-posting Tony Gauvin's bounced message.
 
-John
--Message below re-posted by <jstclair@omsd.cerf.fred.org>
Date - Fri, 21 Nov 1997 16:15:34 -0800
>From - owner-logo-l@gsn.org
To - logo-l-mod
Subject - BOUNCE logo-l@gsn.org:  Admin request: /^subject:\s*help\b/i
>From jstclair@cyberg8t.com  Fri Nov 21 16:15:33 1997
Received: from gandalf.umcs.maine.edu (GANDALF.umcs.maine.edu [130.111.112.21])
	by gsn.org (8.8.8/8.8.8) with SMTP id QAA07681
	for <logo-l@gsn.org>; Fri, 21 Nov 1997 16:15:33 -0800
Received: from agauvin.umcs.maine.edu (AGAUVIN.umcs.maine.edu [130.111.112.59]) by gandalf.umcs.maine.edu (8.6.12/8.6.12) with SMTP id TAA24058 for <logo-l@gsn.org>; Fri, 21 Nov 1997 19:15:52 -0500
Message-Id: <199711220015.TAA24058@gandalf.umcs.maine.edu>
Comments: Authenticated sender is <agauvin@[130.111.112.21]>
From: "Anthony Gauvin" <agauvin@umcs.maine.edu>
To: logo-l@gsn.org
Date: Fri, 21 Nov 1997 19:15:54 -0500
MIME-Version: 1.0
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT
Subject: Help - floating point errors in MSWlogo
Reply-to: agauvin@umcs.maine.edu
X-Confirm-Reading-To: agauvin@umcs.maine.edu
X-pmrqc: 1
Priority: normal
X-mailer: Pegasus Mail for Windows (v2.42a)

   I recently wrote a Molecular dynamics simulation in MSW LOGO and 
ran into a problem in how LOGO handles floating points numbers. One 
of the calculations in the program was 
 
    make "time sum :delta_t :time   

Adding a delta_t of  0.02 to a time of  0  1640 times gave me a 
value of time that was 32.7799999999995 , that is a small error but 
an error none the less. The problem is that with more iterations of the
program  the error grows exponential and after  a hour or so 
of running the simulations the values walk straight into the 
ether.
 This poses a severe limitations on the type 
and scale of models that can be constructed in LOGO. I realize that 
I'm probably pushing LOGO beyond it intended domain but you except 
the correct answer from a computer 

  As a test of this error, I wrote the following program 

to  atest 
(local "times "number)
make "number 0 
for [j 1 6 1 ]~
  [ make "times power 10 :j
    type [times -> ] 
    print :times  
    for[i 1 :times 1]~
        [make "number sum :number 0.01]
    type [result -> ]
    print :number 
    make "number 0
  ]  
end

  Running the program produces the same wrong results on two different 
machines (one WIN95, the other WINNT). 
********************************************************************

  Tony Gauvin                       (207) 581-1367          
  Graduate Assistant                 agauvin@umcs.maine.edu  
  109 Neville Hall                                         
  Dept of Computer Science                                 
  University of Maine                            
  Orono Me 04469                                           
 
          HTTP://www.umfk.maine.edu/hpage/tony/menu.htm    

******************************************************************************  
                                                     
                                                               


---------------------------------------------------------------
Please post messages to the Logo forum to logo-l@gsn.org.  Mail
questions about the list administration to logofdn@gsn.org.  To
unsubscribe send    unsubscribe logo-l    to majordomo@gsn.org.



Global SchoolNet Foundation - Linking Kids Around the World!
Copyright GSN - All Rights Reserved - Comments & Questions
Visit GSN's Global Schoolhouse for more exciting learning resources!
Search our Site - Home