1d0 versus 1.0d0

Is 1d0 the same as 1.0d0 for gfortran?

1 Like

Yes, double precision. You can use the kind() function to know:

print *, 1d0, 1.0d0, 1.0
print *, kind(1d0), kind(1.0d0), kind(1.0)
$ ./a.out
   1.0000000000000000        1.0000000000000000        1.00000000    
           8           8           4

See KIND (The GNU Fortran Compiler)

3 Likes