Skip to content

Instantly share code, notes, and snippets.

@michiel
Created May 31, 2013 01:28
Show Gist options
  • Select an option

  • Save michiel/5682459 to your computer and use it in GitHub Desktop.

Select an option

Save michiel/5682459 to your computer and use it in GitHub Desktop.
Newton's square root method in coffeescript
sqrt = (x, conv=10)->
y = 1
for i in [0..conv]
y = y - ((y*y - x) / (2*y))
y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment