主题:(-500)^0.7在Fortran中计算问题。
(-500)^0.7在Fortran中计算问题。
(-500)^0.7
在matlab中的结果为 -45.5510 +62.6955i
在compaq fortran中计算为:
(NaN,0.000000000000000E+000)
Press any key to continue
做甚解呢?
在fortran中怎么算出正确答案呢。谢谢
fortran中程序如下:
PROGRAM KK
IMPLICIT NONE
COMPLEX(KIND=8)::A
A=(-500)**0.7
WRITE(*,*)A
END PROGRAM KK
[em10]
(-500)^0.7
在matlab中的结果为 -45.5510 +62.6955i
在compaq fortran中计算为:
(NaN,0.000000000000000E+000)
Press any key to continue
做甚解呢?
在fortran中怎么算出正确答案呢。谢谢
fortran中程序如下:
PROGRAM KK
IMPLICIT NONE
COMPLEX(KIND=8)::A
A=(-500)**0.7
WRITE(*,*)A
END PROGRAM KK
[em10]