Home  |   Notes  |   Languages  |   Programs  |   Homework

Re: FW: [CS3304_91312] implementing remainder(was: cs 3304)

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:39:55 -0400


Message-ID:  <3BD421AB.48F92E3A@cs.vt.edu>
Date:         Mon, 22 Oct 2001 09:39:55 -0400
From: Stephen Edwards <edwards@CS.VT.EDU>
Subject:      Re: FW: [CS3304_91312] implementing remainder(was: cs 3304)

> I have some other
> questions involving floating point.

First, read my last message to the list. Then read the section on
numbers and numeric representations in the scheme reference.

Now to be clear: NO FLOATING POINT MATH OPERATIONS ARE REQUIRED FOR
THIS ASSIGNMENT. The only time you will need to deal with floating
point numbers at all is when the final answer for an expression is
an exact rational quantity. In that case, you'll need to print out
the rational number, then convert it to a flonum to print the
equivalent floating point representation. The default flonum
precision produced by write or display are what you should use.

> What are the precision for the outputs
> of the following:
>
> 1.0 + 1.0 (Scheme gives a default 2. <-no zero at end)
> 2 + 1.0
> 1.4 + 1.4

These will never happen, since you'll need to manipulation *rational*
quantities (fractions) rather than flonums.

> ie-what are the universal rules for this program regarding the results of
> floating point, or floating point/integer computations?

See above--there are no floating point computations to perform, and there
are no mixed floating point/integer computations to perform.

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