I have a very large number:
char *big_numbr_str = "4325242066733762057192832260226492766115114212292022277";
I want to keep the square rooting of this number until it is <1000. In PHP, I can do this relatively easily:
while($num > 1000):
$num = sqrt($num);
endwhile;
$num = floor($num);
Now I am trying to achieve the same result in C to end the same result. For reference, after 5 cycles in the while loop, the final PHP result from the above snippet + start number is 50; If you twist this number 5 times in another place, you should get a similar result, rounded down.
How can I achieve the same in simple C? It seems that storing that amount in C is more than expected.
Tiago source
share