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

Scott Preddy (spreddy@VT.EDU)
Sun, 21 Oct 2001 12:47:05 -0400


Message-ID:  <3BD2FC09.BB9E9606@vt.edu>
Date:         Sun, 21 Oct 2001 12:47:05 -0400
From: Scott Preddy <spreddy@VT.EDU>
Subject:      Re: FW: [CS3304_91312] implementing remainder (was: cs 3304)

Thanks,

I found this e-mail right after I sent my last message. I have some other
questions involving floating point. 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

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

Vincent Vance wrote:

> -----Original Message-----
> From: discussion list [mailto:CS3304_91312@listserv.vt.edu] On Behalf Of
> Stephen Edwards
> Sent: Wednesday, October 10, 2001 1:54 PM
> To: CS3304_91312@LISTSERV.VT.EDU
> Subject: Re: [CS3304_91312] implementing remainder (was: cs 3304)
>
> > Use the Scheme numeric function "remainder" to compute the result of
> an
> > irem command. For the above example, (remainder -13 4) returns -1.
>
> Another clarification: since the built-in remainder function requires
> integer arguments, use (remainder (round arg1) (round arg2)) to
> implement
> irem. "round" is a built-in function that rounds to the nearest
> integer.
>
> -- 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>