Please explain what does 0.0_p2
and 1.0_p2
mean here.
integer , parameter :: sp = kind(1.0)
integer , parameter :: p2 = selected_real_kind(2*precision(1.0_sp))
real(p2), parameter :: zero = 0.0_p2, &
one = 1.0_p2
Please explain what does 0.0_p2
and 1.0_p2
mean here.
integer , parameter :: sp = kind(1.0)
integer , parameter :: p2 = selected_real_kind(2*precision(1.0_sp))
real(p2), parameter :: zero = 0.0_p2, &
one = 1.0_p2
Copyright © 2021 Jogjafile Inc.
The term
is the real number
0.0
with kindp2
. The snippet you've posted tells us thatp2
denotes the kind returned by the expressionso
p2
is probably the same asdouble precision
, and also probably a 64-bit real number.