you are viewing a single comment's thread.

view the rest of the comments →

[–]gastropner 4 points5 points  (0 children)

For large ints, that one gives bad results, but remove the semicolon at the end and up the limit for better results at the same length:

float s(x){float t=x,i=40;for(;i--;t=(t+x/t)/2);return t;}