【SICP练习】133 练习3.64
2015-09-08 00:00
211 查看
练习3-64
原文
Exercise 3.64. Write a procedure stream-limit that takes as arguments a stream and a number (the tolerance). It should examine the stream until it finds two successive elements that differ in absolute value by less than the tolerance, and return the second of the two elements. Using this, we could compute square roots up to a given tolerance by(define (sqrt x tolerance) (stream-limit (sqrt-stream x) tolerance))
代码
(define (stream-limit stream tolerance) (if (< (abs (- (stream-ref stream 1) (stream-ref stream 0))) tolerance) (stream-ref stream 1) (stream-limit (stream-cdr stream) tolerance)))
感谢访问,希望对您有所帮助。 欢迎关注或收藏、评论或点赞。
为使本文得到斧正和提问,转载请注明出处:
http://blog.csdn.net/nomasp
版权声明:本文为 NoMasp柯于旺 原创文章,未经许可严禁转载!欢迎访问我的博客:http://blog.csdn.net/nomasp
相关文章推荐
- Java IO与NIO的一些文件拷贝测试
- Mysql limit 优化,百万至千万级快速分页 复合索引的引用并应用于轻量级框架
- mysql delete limit 使用方法详解
- Mysql limit 优化,百万至千万级快速分页 复合索引的引用并应用于轻量级框架
- mysql 前几条记录语句之(limit)
- Stream、WshShell、WshUrlShortcut对象及Shell.Application的参数与使用
- 详解mysql的limit经典用法及优化实例
- Node.js中的流(Stream)介绍
- php中stream(流)的用法
- php错误提示failed to open stream: HTTP request failed!的完美解决方法
- js arguments对象应用介绍
- javascript奇异的arguments分析
- JavaScript的arguments对象应用示例
- Mysql limit 优化,百万至千万级快速分页 复合索引的引用并应用于轻量级框架
- mysql limit分页优化方法分享
- mysql查询语句通过limit来限制查询的行数
- Mysql子查询IN中使用LIMIT应用示例
- php下MYSQL limit的优化
- ROW_NUMBER SQL Server 2005的LIMIT功能实现(ROW_NUMBER()排序函数)
- Mysql limit 优化,百万至千万级快速分页 复合索引的引用并应用于轻量级框架