I think there was a table optimization for this as well, so that you had a table with a number of roots and its squares, you pick up the highest one so you start the subtraction from there. So for example you want to know the square of 70000, which would be 264, therefore 264 loops in the original algorithm. But then you pick the number 65536 which has the root of 256, so you start with your calculus from there saving 256 steps. The finest resolution your table is the more steps you can save in average, however, there is a lag for the table lookup too. Tamas On 5 December 2011 14:56, dipten wrote: > This is because > *1+3+5+7+... +n th odd integer =3D n square.* > This can be proved by simple arithmetic series sum formula. > Deep. > > > On Mon, Dec 5, 2011 at 7:48 PM, Electron wrote: > > > > > Hello, > > > > analogously to [division] computing the quotient by counting how many > > times you > > can subtract the divisor, you can compute the square root of a number > > counting > > how many times you can subtract sequential odd numbers (1,3,5,7,9,=85). > > > > [ try it -- it works!]. e.g. 25 -1-3-5-7-9 =3D 0 > > > > OK, but can someone explain me *why* it works? :-) > > > > Thanks, > > Mario > > > > -- > > http://www.piclist.com PIC/SX FAQ & list archive > > View/change your membership options at > > http://mailman.mit.edu/mailman/listinfo/piclist > > > > > > -- > > "The purpose of life is not to be happy. It is to be useful, to be > honourable, to be compassionate, to have it make some difference that you > have lived and lived well." --- *Ralph Waldo Emerson* > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > --=20 int main() { char *a,*s,*q; printf(s=3D"int main() { char *a,*s,*q; printf(s=3D%s%s%s, q=3D%s%s%s%s,s,q,q,a=3D%s%s%s%s,q,q,q,a,a,q); }", q=3D"\"",s,q,q,a=3D"\\",q,q,q,a,a,q); } --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .