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.
12 lines
357 B
12 lines
357 B
2 years ago
|
|
||
|
Exercise 1.25: Alyssa P. Hacker complains that
|
||
|
we went to a lot of extra work in writing expmod. After all, she says,
|
||
|
since we already know how to compute exponentials, we could have simply written
|
||
|
|
||
|
|
||
|
(define (expmod base exp m)
|
||
|
(remainder (fast-expt base exp) m))
|
||
|
|
||
|
Is she correct? Would this procedure serve as well for our fast prime tester?
|
||
|
Explain.
|