Home | Notes | Languages | Programs | Homework |
Re: implementing remainder (was: cs 3304) |
Stephen Edwards (edwards@CS.VT.EDU)
Wed, 10 Oct 2001 13:53:54 -0400
Message-ID: <3BC48B32.B999F955@cs.vt.edu> Date: Wed, 10 Oct 2001 13:53:54 -0400 From: Stephen Edwards <edwards@CS.VT.EDU> Subject: Re: 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 -------------------------------------------------------------------------------
Home | Notes | Languages | Programs | Homework |