Intrinsic functions (2)

Numeric inquiry functions

radix(x) integer model base
minexponent(x) integer min. exponent
maxexponent(x) integer max. exponent
digits(x) integer significant digits
precision(x) integer decimal precision
range(x) integer decimal exponent
tiny(x) real smallest positive
huge(x) real largest
epsilon(x) real small rel. to 1.
program numeric_inquiry
! Ulrich Schmitt, 2002-10-21
implicit none
real :: x
print *, radix(x), minexponent(x), maxexponent(x)
print *, digits(x), precision(x), range(x)
print *, tiny(x), huge(x), epsilon(x)
end

32 bit:

           2        -125         128
          24           6          37
  1.1754944E-38  3.4028235E+38  1.1920929E-07

64 bit:

           2       -1021        1024
          53          15         307
  2.225073858507201E-308  1.797693134862316E+308  2.220446049250313E-016

Real-time clock

call date_and_time ([date] [, time] [, zone] [, values])

date scalar character variable holding the date in the form ccyymmdd (century, year, month, day)

time scalar character variable holding the time in the form hhmmss.sss (hours, minutes, seconds, milliseconds)

zone scalar character variable holding the difference between local time and UTC (Coordinated Universal Time, GMT Greenwich Mean Time) in the form Shhmm (sign, hours, minutes)

values rank-1 integer array of size 8 (year, month, day, zone/min, hour, minutes, seconds, milliseconds)

call system_clock ([count] [, count_rate] [, count_max])

count scalar integer holding current value of processor clock

count_rate scalar integer holding number of counts per second

count_max scalar integer holding maximum value for count

Random numbers

A sequence of processor-dependent pseudorandom numbers is generated from a seed.

call random_number (harvest)

harvest real scalar or array. Uniform distribution [0, 1)

call random_seed ([size] [put] [get])

No more than one argument may be specified.

size scalar integer returns size n of seed array

put rank-1 integer array of size n to reset the seed

get rank-1 integer array returns the seed