Skip to content

Instantly share code, notes, and snippets.

@joshkunz
Created June 29, 2015 21:11
Show Gist options
  • Save joshkunz/d238cc9e624f83bb24fd to your computer and use it in GitHub Desktop.
Save joshkunz/d238cc9e624f83bb24fd to your computer and use it in GitHub Desktop.
Continuted fraction square root function.
def msqrt(n):
x = 1
for i in xrange(100):
x = 1 + (float(n - 1) / (x + 1))
return x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment