Skip to content

Instantly share code, notes, and snippets.

@joshuashaffer
Last active February 19, 2017 22:24
Show Gist options
  • Save joshuashaffer/275046b9f722caa92e9d8e9a9943dc1e to your computer and use it in GitHub Desktop.
Save joshuashaffer/275046b9f722caa92e9d8e9a9943dc1e to your computer and use it in GitHub Desktop.
Compute Sqrt, Decimal Digit at a Time, As List.
w x r=d:w(100*(x-20*r*d-d*d))(10*r+d)
where d=head(filter(\d -> 20*r*d+d*d>=x)[0..])-1
sqrt_digits n = w n 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment