! Program Example from "Essential Fortran 90 & 95" by Loren P. Meissner
! Copyright 1996. Copying for sale requires permission from the author.
! Otherwise, distribution is permitted if these three lines are included.

! Exercises 1.5, Number 2.
  program B5X02
    implicit none
    real, parameter :: R1 = 1.0
    integer, parameter :: I = 1, D = selected_real_kind( 2 * precision( R1 ) )
    real (kind = D), parameter :: R2 = 1.0_D
! start program B5X02
    write (unit = *, fmt = *) " DEFAULT INTEGER "
    write (unit = *, fmt = *) " KIND number = ", kind( I )
    write (unit = *, fmt = *) " Digits = ", digits( I )
    write (unit = *, fmt = *) " Radix = ", radix( I )
    write (unit = *, fmt = *) " Range = ", range( I )
    write (unit = *, fmt = *) " Huge = ", huge( I )
    write (unit = *, fmt = *) " Bit_Size = ", bit_size( I )
    write (unit = *, fmt = *)
    write (unit = *, fmt = *) " DEFAULT REAL "
    write (unit = *, fmt = *) " KIND number = ", kind( R1 )
    write (unit = *, fmt = *) " Digits = ", digits( R1 )
    write (unit = *, fmt = *) " MaxExponent = ", maxexponent( R1 )
    write (unit = *, fmt = *) " MinExponent = ", minexponent( R1 )
    write (unit = *, fmt = *) " Precision = ", precision( R1 )
    write (unit = *, fmt = *) " Radix = ", radix( R1 )
    write (unit = *, fmt = *) " Range = ", range( R1 )
    write (unit = *, fmt = *) " Epsilon = ", epsilon( R1 )
    write (unit = *, fmt = *) " Spacing = ", spacing( R1 )
    write (unit = *, fmt = *) " Tiny = ", tiny( R1 )
    write (unit = *, fmt = *) " Huge = ", huge( R1 )
    write (unit = *, fmt = *)
    write (unit = *, fmt = *) " HIGH PRECISION REAL "
    write (unit = *, fmt = *) " KIND number = ", kind( R2 )
    write (unit = *, fmt = *) " Digits = ", digits( R2 )
    write (unit = *, fmt = *) " MaxExponent = ", maxexponent( R2 )
    write (unit = *, fmt = *) " MinExponent = ", minexponent( R2 )
    write (unit = *, fmt = *) " Precision = ", precision( R2 )
    write (unit = *, fmt = *) " Radix = ", radix( R2 )
    write (unit = *, fmt = *) " Range = ", range( R2 )
    write (unit = *, fmt = *) " Epsilon = ", epsilon( R2 )
    write (unit = *, fmt = *) " Spacing = ", spacing( R2 )
    write (unit = *, fmt = *) " Tiny = ", tiny( R2 )
    write (unit = *, fmt = *) " Huge = ", huge( R2 )
    write (unit = *, fmt = *)
    stop
  end program B5X02
