fortran basic help 'd' operator [duplicate]

本秂侑毒 提交于 2019-12-11 20:16:23

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!