Square root algorithm

10 messages
Open this post in threaded view
|

Square root algorithm

 Hi,To help me in learning Haskell I started blogging about some of the things I’ve looked at. One such topic was calculating square roots ‘by hand’ and then deriving a Haskell algorithm. I wrote about the well known  technique herehttp://gitcommit.co.uk/2017/08/25/the-root-of-the-problem-part-1/and it it is really quite a simple method. The second part of the post will be an implementation in Haskell. I then tried implementing it  and got something that works but really its not very pleasant to look at! And its something I don’t want to post! Some parts are fine but I think I locked myself into the notion that it had to be using State and  really the end result is pretty poor. I know this i perhaps a ‘big ask’ but I’d really appreciate any suggestions, solutions, hints etc. I will of course give full attribution. I’ve created a gist of the code herehttps://gist.github.com/banditpigMany ThanksMike_______________________________________________ Beginners mailing list [hidden email] http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
Open this post in threaded view
|

Re: Square root algorithm

 I don't know why this email was marked as spam, but it could be worth discussing.On Sun, Sep 3, 2017 at 4:22 PM, mike h wrote:Hi,To help me in learning Haskell I started blogging about some of the things I’ve looked at. One such topic was calculating square roots ‘by hand’ and then deriving a Haskell algorithm. I wrote about the well known  technique herehttp://gitcommit.co.uk/2017/08/25/the-root-of-the-problem-part-1/and it it is really quite a simple method. The second part of the post will be an implementation in Haskell. I then tried implementing it  and got something that works but really its not very pleasant to look at! And its something I don’t want to post! Some parts are fine but I think I locked myself into the notion that it had to be using State and  really the end result is pretty poor. I know this i perhaps a ‘big ask’ but I’d really appreciate any suggestions, solutions, hints etc. I will of course give full attribution. I’ve created a gist of the code herehttps://gist.github.com/banditpigMany ThanksMike_______________________________________________ Beginners mailing list [hidden email] http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners _______________________________________________ Beginners mailing list [hidden email] http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
Open this post in threaded view
|

Re: Square root algorithm

Open this post in threaded view
|

Re: Square root algorithm

Open this post in threaded view
|

Re: Square root algorithm

Open this post in threaded view
|

Re: Square root algorithm

Open this post in threaded view
|

Re: Square root algorithm

Open this post in threaded view
|