博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
得到一个数的立方
阅读量:6595 次
发布时间:2019-06-24

本文共 998 字,大约阅读时间需要 3 分钟。

;; The first three lines of this file were inserted by DrRacket. They record metadata;; about the language level of this file in a form that our tools can easily process.#reader(lib "htdp-advanced-reader.ss" "lang")((modname e18) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #t #t none #f ())))(define (div-three x)  (/ x 3.0));;(div-three 1 3)(define (three-times x)  (* x x x));;(three-times 2)(define (square x)  (* x x)  );;(square 2)(define (make-nums guess x)  (+ (+ guess guess) (/ x (square guess)))) ;;(make-nums 2 8)(define (improve guess x)  (div-three (make-nums guess x))  );;(improve 2 8)(define (good-enough? guess x)  (< (abs (- (three-times guess) x)) 0.001));;(good-enough? 2 8)(define (cube-root-iter guess x )  (if (good-enough? guess x)      guess      (cube-root-iter (improve guess x) x)));;(cube-root-iter 2 8)(define (cube-root x)  (cube-root-iter 1.0 x))(cube-root 27)

转载于:https://www.cnblogs.com/impact-crusher/p/3368092.html

你可能感兴趣的文章
自言自语
查看>>
【转载】十步完全理解SQL
查看>>
switch-case语句
查看>>
trim 函数
查看>>
java安装文件简介
查看>>
图像拼接 SIFT资料合集
查看>>
大道至简阅读笔记01
查看>>
第十周作业
查看>>
web基础
查看>>
翻译 解决 Resource Already Exists on Disk Errors in Eclipse
查看>>
sparkstreaming写入hbase表中总结
查看>>
javascript基础-预编译
查看>>
JS获取客户端系统当前时区
查看>>
不只是提醒:2009年10大安全威胁
查看>>
微软推出HTML5实验室站点及两项原型技术
查看>>
RabbitMQ源码解析前奏--AMQP协议
查看>>
Spring学习(2)---IOC
查看>>
tcp回显客户端发送的数据
查看>>
mybatis #{} 和 ${}
查看>>
VC++6.0在win8.1系统下运行失败的解决办法
查看>>