2009-04-16から1日間の記事一覧

今日の夕飯

マーボ茄子 切り干し大根の煮物(平切大根,豚バラ肉,椎茸,茹で豚の茹で汁) 豚バラ肉と青梗菜の炒め物

SICP問題1.38

整数の割り算の答えだけってどうやって取るのか分からんのででっち上げる (define (divide-integer x y) (let ((r (remainder x y))) (if (= r 0) (/ x y) (/ (- x r) y)))) (define (euler k) (cont-frac (lambda (i) 1.0) (lambda (i) (if (= (remainder i…

SICP問題1.37

再帰的プロセスの cont-frac (define (cont-frac fn fd k) (define (recursive-frac i) (let ((n (fn i)) (d (fd i))) (if (= i k) (/ n d) (/ n (+ d (recursive-frac (+ i 1))))))) (recursive-frac 1) ) 4桁の精度の近似を得るのにどれくらいの大きさが必…

SICP問題1.36

修正した fixed-point (define (fixed-point f first-guess) (define (close-enough? v1 v2) (< (abs (- v1 v2)) tolerance)) (define (try guess) (let ((next (f guess))) (display next) (newline) (if (close-enough? guess next) next (try next)))) (t…