repo.or.cz
/
propagator.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
adding tangled source files to the repo
[propagator.git]
/
src
/
heron.clj
blob
dffe5ae936d858cdb7b683b081ead96c7b486978
1
2
(in-ns 'propagator)
3
(cell guess 1)
4
(cell x 9)
5
(cell done false)
6
(cell margin 0.1)
7
8
(propagator enough [x guess] [done]
9
(Thread/sleep 1000)
10
(if (< (abs (- (* guess guess) x)) @margin) true false))
11
12
(propagator heron [x done guess] [guess]
13
(Thread/sleep 1000)
14
(if done
15
guess
16
(/ (+ guess (/ x guess)) 2.0)))