0
Je vous écris le code suivant dans Fortran et ayant erreur avec la fonction definintionerreur avec définition de la fonction Fortran
program bisection_method
implicit none
real:: a=2.5,b=4.5,c,f
if (f(a)*f(b).gt.0) then
write(*,*) "error"
else
do while ((b-a)/2.0>0.0001)
c = (a+b)/2.0
if (f(a)*f(c).lt.0) then
c = a
else
c = b
endif
enddo
endif
write(*,*)"the root is ",c
end program
function f(x)
implicit none
real::f,x
f=(16*(x^3)-385*(x^2)+6000*(x)-3125)
end function f
et ayant l'erreur suivante
fbisection.f90:24:9:
f=(16*(x^3)-385*(x^2)+6000*(x)-3125)
1
Error: Expected a right parenthesis in expression at (1)
Toute idée pourquoi cela se passe? Merci
ne savais pas que, je vous remercie! –