在Fortran中,DATA INF / 1.D + 300 /是什么意思? [英] What does DATA INF/1.D+300/ mean in Fortran?
问题描述
<$ p $ D
DATA INF / 1.D + 300 /
INF的值是多少?
D
表示× 10 1.e + 300 $>中的
e
c $ c>,但它是双精度的。
DOUBLE PRECISION
语句只是将3个变量定义为类型 double
。
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屋!