您的位置:首页 > 其它

Using Fixpoint to Solve Mathmatic Equation ( 无限float运算的扩展 fixpoint style)

2011-04-02 10:43 405 查看
(defun fixpoint ( x y)

(funcall y (funcall x x y) )

)

(setq fun (fixpoint 'fixpoint

(lambda (s)

(lambda ( f check init result)

(if (funcall check (funcall f init) init )

result

(progn

(print init)

(print result)

(funcall s f check (funcall f init) (+ result init) )

)

)

)

)

)

)

(funcall fun (lambda(x)(/ x 2 ) )

(lambda (x y)(if (< (abs (- x y)) (/ 1 1000000) ) t nil)) 1 0)

(funcall fun (lambda(x)(/ x 2 ) )

(lambda (x y)(if (< (abs (- x y)) (/ 1 1000000) ) t nil)) 2 0)

(funcall fun (lambda(x)(/ x 2 ) )

(lambda (x y)(if (< (abs (- x y)) (/ 1 1000000) ) t nil)) 3 0)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: