small sync
This commit is contained in:
parent
c43a63cc2e
commit
89c1d3be54
14
MIT/sqrt.scm
Normal file
14
MIT/sqrt.scm
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
(define (sqrt x)
|
||||||
|
(define tolerance 0.00001)
|
||||||
|
(define (good-enough? y)
|
||||||
|
(< (abs (- (* y y) x)) tolerance))
|
||||||
|
(define (improve y)
|
||||||
|
(average (/ x y) y))
|
||||||
|
(define (try y)
|
||||||
|
(if (good-enough? y)
|
||||||
|
y
|
||||||
|
(try (improve y))))
|
||||||
|
(try 1))
|
||||||
|
(sqrt 13)
|
||||||
|
|
||||||
|
|
1
Structure/test.scm
Normal file
1
Structure/test.scm
Normal file
|
@ -0,0 +1 @@
|
||||||
|
(define add2(+ 2))
|
5
fixum/hello.scm
Normal file
5
fixum/hello.scm
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
; The first program
|
||||||
|
|
||||||
|
(begin
|
||||||
|
(display "Hello, World!")
|
||||||
|
(newline))
|
Binary file not shown.
Loading…
Reference in a new issue