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)
(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)
相关文章推荐
- Using Fixpoint to Solve Mathmatic Equation ( 无限float运算的扩展 stream style)
- Using Fixpoint to Solve Mathmatic Equation ( x= sin x fixpoint style)
- How to solve second button click download problem on SharePoint 2010
- Using R to Fix Data Quality: Section 0
- [ solr扩展 ] Different ways to implement autosuggest using SOLR
- Using SharePoint 2003 Web Services to Retrieve Data From A List
- Using the ForeFront Identity Manager to Configure SharePoint 2010’s User Profile Sync Service
- Using Wppackager to Package and Deploy Web Parts for Microsoft SharePoint Products and Technologies
- Upload a file to Sharepoint 2007 using webservices with a specific content type
- 使用Z-Bias解决Z-Fighting问题的替代方案 Alternatives to Using Z-Bias to Fix Z-Fighting Issues
- Update list item using Linq to SharePoint
- Using SharePoint Web Services to Fill Out an InfoPath Form
- How to solve Check Out Green Icon Position Problem on SharePoint 2010
- Using R to Fix Data Quality: Section 1
- Using R to Fix Data Quality: Section 5
- Developers are hitting a problem due to tools.jar when using Checkstyle
- sharepoint ECMA using a custom contentType to creating a list in SubSite
- Using VisualVM to fix live Tomcat and JVM problems
- How to solve the linking errors when using the ATOMIC functions
- 继续摘抄:How to fix Apache – “Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName”