當(dāng)我用一個function,用contains包含另外一個function 時就出錯了 不用contains 結(jié)構(gòu),分開寫,就又沒問題了function se(x) implicit noneinteger nreal x,h,he,tx,sen=1tx=h(n)*x**(2*n)he=txdo while(abs(tx)>=1e-10)n=n+1tx=h(n)*x**(2*n)he=he+txenddose=1+hecontainsfunction h(n) result(k)implicit noneinteger i,nreal pim,term1,term2,e,s,kpim=(2/3.1415926)**(2*n+1)term1=1term2=1e=term1/term2s=1i=1do while(abs(e)>=1e-10)i=i+1term1=(-1.0)**(real(i)-1)term2=(2*real(i)-1)**(2*n+1)e=term1/term2s=s+eenddok=2*pim*send function hend function seprogram eximplicit nonereal se,xread*,xprint*,se(x)endD:\My Documents\fortran save\Text1.f90(15) : Error: The name of the internal procedure conflicts with a name in the encompassing scoping unit. [H]function h(n) result(k)
添加回答
舉報
0/150
提交
取消