You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
427 B
15 lines
427 B
|
|
Exercise 3.58: Give an interpretation of the
|
|
stream computed by the following procedure:
|
|
|
|
|
|
(define (expand num den radix)
|
|
(cons-stream
|
|
(quotient (* num radix) den)
|
|
(expand (remainder (* num radix) den)
|
|
den
|
|
radix)))
|
|
|
|
(Quotient is a primitive that returns the integer quotient of two
|
|
integers.) What are the successive elements produced by (expand 1 7
|
|
10)? What is produced by (expand 3 8 10)?
|
|
|