[plt-scheme] Syntax for Maximum Number

From: Robby Findler (robby at cs.uchicago.edu)
Date: Wed Jan 23 10:16:55 EST 2008

There are many functions built into the teaching langauges for things
like that. One good way to find them is to guess at their names and
then use the interactions (bottom) window of DrScheme to see if you
guessed right. You can, of course, also search in Help Desk.

In this case, you want `max'. Here's some experimentation to give you an idea:

> (max 1 2)
2
> (max 223/457 678/983)
678/983
> (abs (- 223/457 678/983))
90637/449231
> (/ (floor (* 10 (abs (- 223/457 678/983)))) 10)
1/5

Robby

On Jan 22, 2008 12:04 PM, Mr. Watson <graphettion at gmail.com> wrote:
> I am reading the How to Design Programs: An introduction to Computers
> and Programming book and I am wondering what the syntax is for finding
> the maximum number of two numbers.
>
> Thanks,
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>


Posted on the users mailing list.