fortran基本帮助'd'操作员 [英] fortran basic help 'd' operator

查看:160
本文介绍了fortran基本帮助'd'操作员的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能存在重复:

$ 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 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.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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆