Re: tcl8.5: large float-value to very wide int ?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: tcl8.5: large float-value to very wide int ?

From: Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at>
Date: Tue Dec 13 2005 - 14:21:41 CET

keithv <kvetter@gmail.com> wrote:
> You might want to look at adapting the paper-and-pencil
> method of taking square roots. The algorithm adapts
> really nicely to binary numbers and only involves shifts
> subtractions and compares. Check out http://wiki.tcl.tk/SquareRoot.

I now use the snippet, someone recently posted, using
Newton's method, and it is indeed about 25 times faster
than calling out to "dc" :-)

I'll further hold my breath till isqrt gets checked in on
CVS, and blame Kevin Kenny, in case I suffocate ;-)
Received on Fri Dec 23 18:59:59 2005