<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
Buen dia amigos.<BR>
 <BR>
Tengo un pequeño problema con un programa simple: <BR>
 el programa trata de emplear el metodo de biseccion(es un metodo numerico), esta es una parte del programa <BR>
 <BR>
float biseccion( double x_in,double x_fin,float e_max){<BR>     double x_r,fx_in,fx_r,x_r2=0;<BR>     float error=100;<BR>     int i=0;<BR><BR>
    while ( error>=e_max){<BR><BR>
        x_r= x_in+x_fin/2; //obtiene punto medio Xr<BR>        fx_in= f_(x_in); // obtien Y inicial y Y del pnt medio<BR>        fx_r = f_(x_r);<BR>        if (fx_in*fx_r<0) x_fin=x_r;<BR>        else if (fx_in*fx_r>0) x_in=x_r;<BR>        else if (fx_in*fx_r==0) break;<BR>            break;<BR>        <BR>        if (x_r2!=0)<BR>            error=(x_r2-x_r/x_r2)*100;<BR>        if (error<0) error= -1*error;<BR>                   //if(error==0) error=100;<BR>        x_r2=x_r;<BR>        i++;<BR>    }<BR>printf("\n =D");<BR>    printf("La raiz de la funcion es: %lf \n Iteracion necesarias %d\n",x_r,i);<BR>    printf("La funcion de la raiz es: %lf \n Error maximo resultante: %lf\n",fx_r,error);<BR>
}<BR>
float f_ (double x){<BR>    double y;<BR>    y=-2.1+6.21*x-3.9*pow(x,2)+0.667*pow(x,3);<BR>    printf("\n -D");<BR>    return y;<BR>}<BR><BR>
------se supoen que los valores se manejaran como <STRONG><U>flotantes dobles. </U></STRONG><BR>
 <BR>
...EL PROBLEMA ES QUE AL HACER LA PRIMER OPERACION   x_r= x_in+x_fin/2; NO DA EL RESULTADO DEBIDO<BR>
Y POR SER x_r UN VALOR QUE SE USA MAS A DELANTE TODO LO DEMAS SALE MAL......<BR>
 <BR>
.....QUE PUEDE SER EL PROBLEMA???...EL TIPO DE DECLARACION?? ... COMO SE LEEN LOS RESULTADOS??..COMO IMPRIMEN??<BR>                                    </body>
</html>