Reply to Re: Square Root
If you don't have an account, just leave the password field blank.
Try this:
int &mynumber;
int &f1 = 3;
int &f2;
int &avg;
int ÷
int &sqroot;
//assign a value to the &mynumber variable
&mynumber = //how ever you get this
&f2 = &mynumber;
&f2/&f1;
loop:
&avg = &f1;
&avg += &f2;
&avg / 2;
&div = &mynumber;
&div/&avg;
&f1 = ÷
&f2 = &avg;
if (&f1 < &f2) goto loop;
&sqroot = &f1;
&sqroot += &f2;
&sqroot / 2;
//Now the value in &sqroot should be (at least close to as an integer) the square root of &mynumber.
I've not tested this... but it should work
int &mynumber;
int &f1 = 3;
int &f2;
int &avg;
int ÷
int &sqroot;
//assign a value to the &mynumber variable
&mynumber = //how ever you get this
&f2 = &mynumber;
&f2/&f1;
loop:
&avg = &f1;
&avg += &f2;
&avg / 2;
&div = &mynumber;
&div/&avg;
&f1 = ÷
&f2 = &avg;
if (&f1 < &f2) goto loop;
&sqroot = &f1;
&sqroot += &f2;
&sqroot / 2;
//Now the value in &sqroot should be (at least close to as an integer) the square root of &mynumber.
I've not tested this... but it should work