Skip to content

Instantly share code, notes, and snippets.

@eschulte
Created May 17, 2010 17:23
Show Gist options
  • Save eschulte/403990 to your computer and use it in GitHub Desktop.
Save eschulte/403990 to your computer and use it in GitHub Desktop.
(in-ns 'propagator)
(cell guess 1)
(cell x 9)
(cell done false)
(cell margin 0.1)
(propagator enough [x guess] [done]
(Thread/sleep 1000)
(if (< (abs (- (* guess guess) x)) @margin) true false))
(propagator heron [x done guess] [guess]
(Thread/sleep 1000)
(if done
guess
(/ (+ guess (/ x guess)) 2.0)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment