【SICP练习】127 练习3.58
2015-09-08 00:00
381 查看
练习3-58
原文
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) ?
分析
(expand 1 7 10) => (quotient (* 1 10) 7) => 1 => (expand (remainder 10 7) 7 10) => (quotient (* 3 10) 7) => 4 => (expand (remainder 30 7) 7 10) => (quotient (* 2 10) 7) => 2 …… …… => 1 4 2 8 5 7 4 2 8 5 7 ... (expand 3 8 10) …… …… => 3 7 5 0 0 0 ...
感谢访问,希望对您有所帮助。 欢迎关注或收藏、评论或点赞。
为使本文得到斧正和提问,转载请注明出处:
http://blog.csdn.net/nomasp
版权声明:本文为 NoMasp柯于旺 原创文章,未经许可严禁转载!欢迎访问我的博客:http://blog.csdn.net/nomasp
相关文章推荐
- mysql procedure
- Java IO与NIO的一些文件拷贝测试
- expand 与 unexpand 命令实例教程
- Stream、WshShell、WshUrlShortcut对象及Shell.Application的参数与使用
- Node.js中的流(Stream)介绍
- php中stream(流)的用法
- php中define用法实例
- php错误提示failed to open stream: HTTP request failed!的完美解决方法
- The remote procedure call failed and did not execute的解决办法
- PHP define函数的使用说明
- SQLSERVER Pager store procedure分页存储过程
- C# Stream 和 byte[] 之间的转换
- typedef和#define的用法以及区别
- PHP中使用hidef扩展代替define提高性能
- 探讨php define()函数及defined()函数使用详解
- 利用stream实现一个简单的http下载器
- 浅谈PHP中Stream(流)
- php常用Stream函数集介绍
- MYSQL存储过程<一>:简单的传入参数、传出参数 3ff0
- MYSQL存储过程<二>:执行用字符串拼成的sql语句 3ff8