黄金分割率是变换x--->1+1/x的不动点,我这里把不动点的误差控制在0.0001
#lang racket
(define (test guess)
(define (enough x y)
(< (abs (- x y)) 0.0001))
(define (try guess)
(let ((next (+ 1 (/ 1 guess))))
(if (enough guess next)
next
(try next))))
(try guess))
(test 99)