A real literal may be specified by any of the following forms:
1.2
1.2e0
1.2d0
1.2_kind
1.2e0_kind
This final one is an example of using a kind specifier and an exponent. So, specific to the question: 1.5e-15_C_DOUBLE
.
There certainly can be cases where 1.5d-15
is not the same as 1.5e-15_C_DOUBLE
. The kind of a double precision and real(C_DOUBLE)
are choices by the Fortran and companion C compilers respectively.
Compilers which allow single and double precision literal constants to be promoted to higher kinds by a compiler flag won't touch real(C_DOUBLE)
.
For real values which have no decimal part, there are additional available forms:
1.
1e0
1.e0
1d0
1.d0
1.e0_kind
1e0_kind
That is, the decimal part is optional, and if an exponent is given the decimal separator is also optional. Note however that 1
is an integer literal, while 1e0
and similar are real.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…