This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; P38 (*) Compare the two methods of calculating Euler's totient function. | |
;; Use the solutions of problems P34 and P37 to compare the algorithms. Take the number of logical inferences as a measure for efficiency. Try to calculate phi(10090) as an example. | |
> (time (phi 10090)) | |
cpu time: 0 real time: 1 gc time: 0 | |
4032 | |
> (time (totient-phi 10090)) | |
cpu time: 4 real time: 4 gc time: 0 | |
4032 | |
> |
0 件のコメント:
コメントを投稿