Last active
February 19, 2017 22:24
-
-
Save joshuashaffer/275046b9f722caa92e9d8e9a9943dc1e to your computer and use it in GitHub Desktop.
Compute Sqrt, Decimal Digit at a Time, As List.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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