>>528
#include <stdio.h>
#include <math.h>
#define EPS 0.0000005 /* 最大誤差 */

int main(void)
{
double x1, x2, x;
int i;

for (i = 1; i <= 30; i++) {
x1 = 0.; x2 = i * i;
while (1) {
if (fabs(x1 - x2) < EPS) {
printf("sqrt(%d) = %f\n", i, (x1 + x2) / 2);
break;
}
x = (x1 + x2) / 2;
if (x * x > i)
x2 = x;
else if (x * x < i)
x1 = x;
else /* x * x == i */ {
printf("sqrt(%d) = %f\n", i, x);
break;
}
}
}
return 0;
}