Home  |   Notes  |   Languages  |   Programs  |   Homework

Re: clairification

New Message Reply About this list Date view Thread view Subject view Author view

Stephen Edwards (edwards@CS.VT.EDU)
Mon, 22 Oct 2001 09:34:55 -0400


Message-ID:  <3BD4207F.54858C97@cs.vt.edu>
Date:         Mon, 22 Oct 2001 09:34:55 -0400
From: Stephen Edwards <edwards@CS.VT.EDU>
Subject:      Re: clairification

> The spec says that our 26 variables will be integers. Does this mean we
> have to check for errors in the variable list (such as a floating point
> or char) as well as in the command list.

No, no such checking is needed. But there is one clarification: the
26 variables will be 26 *numbers* (some may be rational numbers, in the
Scheme sense). In particular, the output produced by one call of your
JVM-interpret command will be used as input to the next call.

> Also does this mean they will always be integers or can floating points
> be added in later (with istore).

Note that scheme typically will *not* represent your numbers as floating
point numbers (flonums, in Scheme terms) in this assignment. When you
get the value of (/ 2 3), it is a rational number represented exactly,
not a floating point number.

> I also want to make sure we
> don’t have to do anything to fractions going to the stack
> (such as precision).

No, there is nothing special to do (just be sure you don't turn exact
rationals into inexact flonums before putting them in variables, which
will almost certainly cause your later computations to lose accuracy).

                                -- Steve

--
Stephen Edwards            604 McBryde Hall          Dept. of Computer Science
e-mail      : edwards@cs.vt.edu           U.S. mail: Virginia Tech (VPI&SU)
office phone: (540)-231-5723                         Blacksburg, VA  24061-0106
-------------------------------------------------------------------------------


New Message Reply About this list Date view Thread view Subject view Author view

Home  |   Notes  |   Languages  |   Programs  |   Homework
copyright © 2001 Virginia Tech, ALL RIGHTS RESERVED
Class site maintained by Stephen H. Edwards <edwards@cs.vt.edu>