program exf3a ! all about numeric declarations implicit none integer, parameter :: float = selected_real_kind(6,30) integer, parameter :: double = selected_real_kind(15,300) real (kind=float) :: x = 0.5_float real*4 :: xx = 0.5 ! float real (kind=double) :: y = 0.5_double real*8 :: yy = 0.5 ! double double precision :: yyy = 0.5 integer (kind=selected_int_kind(2)) :: shortshort = 127 integer (kind=selected_int_kind(4)) :: short = 32767 integer (kind=selected_int_kind(8)) :: long = (2**30-1)+2**30 ! won't take 2**31-1 integer :: k = (2**30-1)+2**30 ! won't take 2**31-1 integer*8 :: kk = 2**30 ! won't take 2**60 kk = kk + kk kk = kk + kk kk = kk + kk kk = kk + kk kk = 4*kk ! 2**38 but not at compile time print *, "exf3a.f90 all about numeric declarations" print *, "real information" print *, "kind(x)=", kind(x), " kind(y)=", kind(y) print *, "kind(xx)=", kind(xx), " kind(yy)=", kind(yy) print *, "kind(yyy)=", kind(yyy) print *, "digits x,y", digits(x), digits(y) print *, "digits xx,yy", digits(xx), digits(yy) print *, "digits yyy", digits(yyy) print *, "epsilon x,y", epsilon(x), epsilon(y) print *, "epsilon xx,yy", epsilon(xx), epsilon(yy) print *, "epsilon yyy", epsilon(yyy) print *, "huge x,y", huge(x), huge(y) print *, "huge xx,yy", huge(xx), huge(yy) print *, "huge yyy", huge(yyy) print *, "maxexponent x,y", maxexponent(x), maxexponent(y) print *, "minexponent x,y", minexponent(x), minexponent(y) print *, "precision x,y", precision(x), precision(y) print *, "radix x,y", radix(x), radix(y) print *, "range x,y", range(x), range(y) print *, "tiny x,y", tiny(x), tiny(y) print *, "sin(x),sin(y)", sin(x), sin(y) print *, "integer information" print *, "kind(shortshort)=", kind(shortshort), shortshort print *, "kind(short)=", kind(short), short print *, "kind(long)=", kind(long), long print *, "kind(k)=", kind(k), k print *, "kind(kk)=", kind(kk), kk end program exf3a