Here is the output from running one of our examples, ch0510.f90
=====================
Real kind information
=====================
kind number
16 1 2 3
digits details
11 24 53 106
epsilon details
9.7656E-04
1.1920929E-07
2.2204460492503131E-16
2.46519032881566189191165177E-32
huge value
65504.
3.4028235E+38
1.7976931348623157E+308
8.98846567431157953864652595E+307
maxexponent value
16
128
1024
1023
minexponent value
-13
-125
-1021
-968
precision details
3 6 15 31
radix details
2 2 2 2
range details
4 37 307 291
tiny details
6.1035E-05
1.1754944E-38
2.2250738585072014E-308
2.00416836000897277799610805E-292
Here is the source file.
program ch0510
implicit none
!
! real arithmetic
!
! 16 bit reals are in the latest IEEE standard.
! we have added tests for that type in this
! program.
!
! 32 and 64 bit reals are normally available.
! The IEEE format is as described below.
!
! 32 bit reals 8 bit exponent, 24 bit mantissa
! 64 bit reals 11 bit exponent, 53 bit mantissa
!
! 128 bit reals and decimal are also in the
! latest IEEE standard.
! We have chosen a portable specification
! for 128 bit reals as Nag use their own.
!
! integer, parameter :: hp = 16
integer, parameter :: hp = selected_real_kind( 3, 4)
integer, parameter :: sp = selected_real_kind( 6, 37)
integer, parameter :: dp = selected_real_kind(15, 307)
integer, parameter :: qp = selected_real_kind(30, 291)
real (hp) :: rhp
real (sp) :: rsp
real (dp) :: rdp
real (qp) :: rqp
print *, ' ====================='
print *, ' Real kind information'
print *, ' ====================='
print *, ' kind number'
print *, ' ', kind(rhp), ' ', kind(rsp), ' ', kind(rdp), ' ', kind(rqp)
print *, ' digits details'
print *, ' ', digits(rhp), ' ', digits(rsp), ' ', digits(rdp), ' ', digits(rqp)
print *, ' epsilon details'
print *, ' ', epsilon(rhp)
print *, ' ', epsilon(rsp)
print *, ' ', epsilon(rdp)
print *, ' ', epsilon(rqp)
print *, ' huge value'
print *, ' ', huge(rhp)
print *, ' ', huge(rsp)
print *, ' ', huge(rdp)
print *, ' ', huge(rqp)
print *, ' maxexponent value'
print *, ' ', maxexponent(rhp)
print *, ' ', maxexponent(rsp)
print *, ' ', maxexponent(rdp)
print *, ' ', maxexponent(rqp)
print *, ' minexponent value'
print *, ' ', minexponent(rhp)
print *, ' ', minexponent(rsp)
print *, ' ', minexponent(rdp)
print *, ' ', minexponent(rqp)
print *, ' precision details'
print *, ' ', precision(rhp), ' ', precision(rsp), ' ', precision(rdp), ' ', precision(rqp)
print *, ' radix details'
print *, ' ', radix(rhp), ' ', radix(rsp), ' ', radix(rdp), ' ', radix(rqp)
print *, ' range details'
print *, ' ', range(rhp), ' ', range(rsp), ' ', range(rdp), ' ', range(rqp)
print *, ' tiny details'
print *, ' ', tiny(rhp)
print *, ' ', tiny(rsp)
print *, ' ', tiny(rdp)
print *, ' ', tiny(rqp)
end program