DBLE(3) - [TYPE:CONVERSION] Converstion to double precision real
result = dble(a)
elemental doubleprecision function dble(a)doubleprecision :: dble TYPE(kind=KIND),intent(in) :: a
o A my be integer, real, complex, or a BOZ-literal-constant o the result is a doubleprecision real.
DBLE(3) Converts A to double precision real type.
o A : a value to convert to a doubleprecision real.
The return value is of type doubleprecision. For complex input, the returned value has the magnitude and sign of the real component of the input value.
Sample program:
program demo_dble implicit none real:: x = 2.18 integer :: i = 5 complex :: z = (2.3,1.14) print *, dble(x), dble(i), dble(z) end program demo_dbleResults:
> 2.1800000667572021 5.0000000000000000 2.2999999523162842
FORTRAN 77
Fortran intrinsic descriptions (license: MIT) @urbanjost
o AIMAG(3) - Imaginary part of complex number o CMPLX(3) - Convert values to a complex type o INT(3) - Truncate towards zero and convert to integer o NINT(3) - Nearest whole number o OUT_OF_RANGE(3) - Whether a value cannot be converted safely. o REAL(3) - Convert to real type
Nemo Release 3.1 | dble (3fortran) | November 02, 2024 |