fortran基本帮助'd'操作员 [英] fortran basic help 'd' operator
问题描述
可能存在重复:
$ b我在Fortran 90中有这样的代码行:
OVERN2 = 1.d + 0 / DBLE(FLOAT( NMODE2))
NMODE2
是一个整数,OVERN2
是一个REAL * 8
。
你能请向我解释这条线是干什么的?我不明白
.d + 0 /
部分?
,如果您还可以将其翻译为C或任何其他更简单的语言。
解决方案
1 .d + 0
只是科学记数法中的双精度字面值,即1.0e0或1.0。
在C中,它将是:
double overn2 = 1.0 /(double)nmode2;
Possible Duplicate:
postfix 'd+0' in Fortran real literal expressionsI have this code line in Fortran 90:
OVERN2 = 1.d+0/DBLE(FLOAT(NMODE2))
NMODE2
is an integer,OVERN2
is aREAL*8
.Can you please explain to me what this line does? I don't understand the
.d+0/
part? if you can also translate that to C or any other easier language.解决方案
1.d+0
is just a double precision literal in scientific notation, i.e. 1.0e0 or just 1.0.In C it would be:
double overn2 = 1.0 / (double)nmode2;
这篇关于fortran基本帮助'd'操作员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!