在Fortran中,DATA INF / 1.D + 300 /是什么意思? [英] What does DATA INF/1.D+300/ mean in Fortran?

查看:516
本文介绍了在Fortran中,DATA INF / 1.D + 300 /是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



<$ p $

D

DATA INF / 1.D + 300 /

INF的值是多少?

解决方案

D 表示× 10 1.e + 300 中的 e c $ c>,但它是双精度的。



DOUBLE PRECISION 语句只是将3个变量定义为类型 double



DATA 语句

  DATA X / Y / 

转换为



  X = Y; 

在C#中。因此,你得到

  double INF = 1.e + 300,DMIN,D12; 

既然 INF 这么大,我相信它意思是Infinity,在这种情况下,最好使用 real IEEE infinity double INF = double.PositiveInfinity,... )。


I'm translating some Fortran to our C# app and I'm trying to figure out what a bit of Fortran means at the top of a function.

  DOUBLE PRECISION INF, DMIN, D12

  DATA INF/1.D+300/

What would the value of INF be?

解决方案

The D means "× 10???", or commonly known as the e in 1.e+300 in C#, but it's for double precision.

The DOUBLE PRECISION statement just defines 3 variables to be of type double.

The DATA statement

DATA X/Y/

translates to

X = Y;

in C#. Hence you get

double INF = 1.e+300, DMIN, D12;

Since INF is so large I believe it means "Infinity", in that case it's better to use the real IEEE infinity (double INF = double.PositiveInfinity, ...).

这篇关于在Fortran中,DATA INF / 1.D + 300 /是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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