![]() |
Fonctions &
constantes mathématiques :
»
<SCRIPT
language="javascript">
var fonc
function go()
{
with (Math)
{
pi=3.141592653589793 ;
e=2.7182818284590452;
n=0;u=10;
fonc="x - log(x)";
fonc=prompt("Votre
fonction f(x) = ",fonc)
u=eval(prompt("x initial = ",u))
pas=prompt("donnez le pas = ",1)
if (pas==null) {return} else
{pas=eval(pas)}
while (1)
{
for(i=n;i<=n+pas;i++){u=f(u)}
n=n+pas;
if (!confirm("U("+n+") = "+u+"\n"+"Ok pour continuer")) return
}
// fin while
}// fin with
}
// fin go()
function f(x)
{with(Math)
{
y=eval(fonc)
return y
}
}
</SCRIPT>