#include <stdafx.h>
#include <stdio.h>
#include <math.h>

float eval_f(float x); /* evaluation of f(x) */

void main()
{ float xl, xm, xh, e, delta;
int i=0;

printf("\nType left bound of the interval : ");
scanf("%f",&xl);
printf("\nType right bound of the interval : ");
scanf("%f",&xh);
printf("\nType acceptible error interval : ");
scanf("%f",&e);
printf("\n");

do{ xm = (xl + xh) /2.0;

printf("%3dth Iteration Root : %f < with error %f >
           \n", ++i, (xl+xh)/2.0, (xh-xl)/2.0);

           if (eval_f(xl) * eval_f(xm) == 0.0 )
                   break;
           else if ( eval_f(xl)*eval_f(xm) < 0.0 )
                   xh = xm;
           else if ( eval_f(xm)*eval_f(xh) < 0.0 )
                   xl = xm;
           else { printf(" \nSomething Wrong ! \n");
           break;

           }
} while(xh - xl > e);
}

float eval_f(float x)
{ float y;

y = log( x + 5.0 ) + x;
return(y);
}


이분법 예제인데 책에 적힌거 똑같이 적었는데도 에러 떠 ;;

이거 왜 안되는지좀 체크 좀 해주면 안될까 ㅠㅜ