错误的未分类语句在(1)的fortran代码中的Archimedes Pi问题
我正在为pi的阿基米德(Archimedes aproximation)做一个代码。 当我在终端中编译代码时,发送未分类的语句错误。
这是代码。
implicit none
real*8 n,P0,P,F,G,H,I,J,pi,L,x
open(10,file='valordepi.out',status='unknown')
P0=2.d0*(2.d0**(0.5d0))
P=P0
do
n=1,100
pi=acos(x)
x=-1
P(n)=P/2.d0**n
F=-P(n)**2.d0
G=(1.d0-F)**0.5d0
H=1.d0-G
I=(2.d0*H)**0.5d0
J=I*2.d0**n
P=J
L=(J-pi)/pi
write(10,*) n,J,L
end do
close(10)
这个想法是检查Archimedes解决方案的近似值,并获取数据进行图形。 当我写n = 1,100问候时,该错误是在线中,
并感谢您的帮助。
i'm doing a code in Fortran for the Archimedes aproximation of Pi.
When I compile the code in the Terminal send the Unclassifiable statement error.
This is the code.
implicit none
real*8 n,P0,P,F,G,H,I,J,pi,L,x
open(10,file='valordepi.out',status='unknown')
P0=2.d0*(2.d0**(0.5d0))
P=P0
do
n=1,100
pi=acos(x)
x=-1
P(n)=P/2.d0**n
F=-P(n)**2.d0
G=(1.d0-F)**0.5d0
H=1.d0-G
I=(2.d0*H)**0.5d0
J=I*2.d0**n
P=J
L=(J-pi)/pi
write(10,*) n,J,L
end do
close(10)
The idea is check the approximation of the Archimedes solution and get the data to do the graphic.
The error is in the line when i wrote n=1,100
Greetings and thanks for the help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我几次检查代码,现在我明白了。
此代码没有错误,只做我问的事情。
感谢大家的答复。
我遇到的错误是
n = 2,50
不在do
行中。I check the code several times, and now i got it like this.
This code don't have errors, and do just what i asked.
Thanks to everyone for the reply.
The error I did was that the
n=2,50
wasn't in thedo
line.