问题
Possible Duplicate:
postfix 'd+0' in Fortran real literal expressions
I have this code line in Fortran 90:
OVERN2 = 1.d+0/DBLE(FLOAT(NMODE2))
NMODE2
is an integer, OVERN2
is a REAL*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:
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;
来源:https://stackoverflow.com/questions/12567575/fortran-basic-help-d-operator