Aller au contenu

Mathc initiation/a268

Un livre de Wikilivres.


Sommaire


Installer et compiler ces fichiers dans votre répertoire de travail.

c2j.c
/* --------------------------------- */
/* save as c2j.c                     */
/* --------------------------------- */
#include  "x_hfile.h"
#include       "fj.h"
/* --------------------------------- */
int main(void)
{
double i;

 clrscrn();
 printf(" Does lim x->0 %s exist ?\n\n", feq);
 printf(" Substituing 0 for x gives 1**(oo).\n");
 stop();


 clrscrn();
 printf(" f : x-> %s\n\n", feq);

 printf(" Approximate f(x) by the right,\n");
 printf(" for x near 0.\n\n");

 for(i=1; i>0.1; i+=-.1)
     printf(" f(%+.0e) = %5.5f || f(%+.0e) = %5.5f || f(%+.0e) = %5.5f\n",
     i,    f(i),
     i*.1, f(i*.1),
     i*.001,f(i*.001)
     );
 stop();


 clrscrn();
 printf(" f : x-> %s\n\n", feq);

 printf(" Approximate f(x) by the left,\n");
 printf(" for x near 0.\n\n");

 for(i=-.9; i<-0.1; i+=.1)
     printf(" f(%+.0e) = %7.5f || f(%+.0e) = %5.5f || f(%+.0e) = %5.5f\n",
     i,    f(i),
     i*.1, f(i*.1),
     i*.001,f(i*.001)
     );
     
 printf(" \n\n");
 printf(" With the table we arrive at the following conjecture.\n\n");
 printf("     lim x->0 %s = e = (%+.5f)  \n\n", feq,exp(1));
 stop();

 return 0;
}
/* --------------------------------- */
/* --------------------------------- */


Exemple de sortie écran :

 Does lim x->0 (1+x**2)**(1./x**2) exist ?

 Substituing 0 for x gives 1**(oo).
 Press return to continue. 

 f : x-> (1+x**2)**(1./x**2)

 Approximate f(x) by the right,
 for x near 0.

 f(+1e+00) = 2.00000 || f(+1e-01) = 2.70481 || f(+1e-03) = 2.71828
 f(+9e-01) = 2.08028 || f(+9e-02) = 2.70735 || f(+9e-04) = 2.71828
 f(+8e-01) = 2.16617 || f(+8e-02) = 2.70963 || f(+8e-04) = 2.71828
 f(+7e-01) = 2.25653 || f(+7e-02) = 2.71165 || f(+7e-04) = 2.71828
 f(+6e-01) = 2.34932 || f(+6e-02) = 2.71341 || f(+6e-04) = 2.71828
 f(+5e-01) = 2.44141 || f(+5e-02) = 2.71489 || f(+5e-04) = 2.71828
 f(+4e-01) = 2.52850 || f(+4e-02) = 2.71611 || f(+4e-04) = 2.71828
 f(+3e-01) = 2.60525 || f(+3e-02) = 2.71706 || f(+3e-04) = 2.71828
 f(+2e-01) = 2.66584 || f(+2e-02) = 2.71774 || f(+2e-04) = 2.71828
 f(+1e-01) = 2.70481 || f(+1e-02) = 2.71815 || f(+1e-04) = 2.71828
 Press return to continue. 


 With the table we arrive at the following conjecture.

     lim x->0 (1+x**2)**(1./x**2) = e = (+2.71828)  

 Press return to continue.